Session Variables PHP5

Session Variables PHP5

Posted by: LLMacD
Posted on: 2007-09-06 10:08:00

I've got two .php pages running under PHP5; one of them creates a session variable, and the other one tries to read it.

When I run TestSession1.php, I'm redirected to TestSession2.php, and see the session ID and the text x2, but no value for $_Session["Dummy"].
I've tried all the ideas in the PHP Manual, but still no joy.
Any thoughts?

TestSession1.php:
<?php
session_start();
$_SESSION['Dummy']="Dummy";

header('Location:TestSession2.php');
?>

TestSession2.php:
<?php
session_start();

echo session_id();
echo $_Session['Dummy'];
echo 'x2';
echo '
';

?>

Re: Session Variables PHP5

Posted by: afieldz
Posted on: 2007-09-06 11:53:00

try $_SESSION -- constants are case-sensitive.

Re: Session Variables PHP5

Posted by: LLMacD
Posted on: 2007-09-06 13:20:00

Hallelujah!

It works!

Many, many thanks!

Tags: php5session variablesphp manualsession iddummy