Here is my problem :
I've build 3 pages in which i try to test that session are being passed to pages :
The point is that it works fine the first time, but i'm on page 2 and i check the page it fails ... I dont understand why ????!!!
page 0:
session_start();
if (!empty($_SESSION))
{
session_destroy();
}
<a href="page1.php">page1</a>
page1
session_start();
//$HTTP_SESSION_VARS['test'] = 1;
// i've test $_SESSION['test'] = 1; too but it seems to work worst
$test=1;
session_register('test');
echo "<!--";
print_r($_SESSION);
echo "<br><br>";
print_r($HTTP_SESSION_VARS);
echo "-->";
<a href='page2.php?PHPSESSID=<?=$PHPSESSID?>'>Page 2</a>
Page 2
session_start();
//if (!empty($_SESSION['test']))
if (!empty($HTTP_SESSION_VARS['test']))
{
echo 'it worked!';
print_r($_SESSION);
echo "<br><br>";
print_r($HTTP_SESSION_VARS);
} else {
echo 'it did not work :(';
echo "<!--";
print_r($_SESSION);
echo "<br><br>";
print_r($HTTP_SESSION_VARS);
echo "-->";
}
<a href="page2.php?PHPSESSID=<?=$PHPSESSID?>">page 2 again</a>
I use php 4.2.3 and :
register_globals ON
session.auto_start ON
session.cache_expire 180
session.cache_limiter nocache
session.cookie_lifetime 0
session.cookie_secure Off
session.gc_maxlifetime 1440
session.gc_probability 1
session.referer_check no value
session.use_cookies On
session.use_trans_sid 0