On Wed, 2003-06-04 at 06:44, Lee A. Stewart wrote:
> Hi...
> Has anyone used PHP on SuSE SLES 8? Session variables?
>
> I have a PHP application that uses session variables, which is supposed to
> write the session file in /tmp. But instead of writing a file with the
> session variables & values, I get zero length files.
>
Are you running with register_globals on or off?
> The application runs great under an older TurboLinux system, but moving it
> to the new SuSE server it fails. I've asked on the PHP list and verified
> the application code is correct. So before I try to rip out the PHP that
> comes with it and update it, I thought I'd see if anyone else has seen this...
>
> Thanks...
> Lee
>
> PS: Here's the world's simplest test to see if it's working...
>
> -- page.php --
> <?
> session_start();
> $test='foobar';
> session_register('test');
> header('Location: page2.php');
> ?>
>
> -- page2.php --
> <?
> session_start();
> echo "test is $test<br>";
> ?>
>
This code would only work in the older / less secure 'register_globals
on' environment.
So... all I can suggest is to turn register_globals on in either your
php.ini or as a php_var in your apache virtual host, restart apache and
try again.
or you could try
<?
session_start();
$test='foobar';
$_SESSION['test'0=$test;
header('Location: page2.php');
?>
-- page2.php --
<?
session_start();
$test=$_SESSION['test'];
echo "test is $test<br>";
?>