note 21190 deleted from ref.session by sniper
| From: | sniper@php.net | Date: | Sun, 28 Jul 2002 00:57:25 +0000 |
| Subject: | note 21190 deleted from ref.session by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-33758@lists.php.net to get a copy of this message | ||
Using PHP 4.2.0, Apache 1.3.24 and Windows 2000, I'm experiencing problems with session
variables. Once register_globals is off, I'm trying to use $_SESSION to read/write a session
variable.
My example have two files: page1.php and page2.php.
--- page1.php -----------------------
<?
session_start();
$_SESSION['sess_var'] = "Hello World!";
echo "The content of session variable is
".$_SESSION['sess_var']."<br>";
?>
<a href = "page2.php">Next page</a>
-------------------------------------
This file outputs correctly what is expected. But next file does not...
--- page2.php -----------------------
<?
session_start();
if (isset($_SESSION['sess_var']))
{
$sess_var = $_SESSION['sess_var'];
echo "The content of \$sess_var is $sess_var<br>";
}
else
echo "The session variable does not exist!<br>";
?>
-------------------------------------
Here I recieve the message about session variable non-existance.
Can anyone help me?