sessions bug
| From: | lists at grunt dot berkeley dot edu | Date: | Sat, 22 Jul 2000 15:38:02 +0000 |
| Subject: | sessions bug | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-7685@lists.php.net to get a copy of this message | ||
Here is a simple example that shows the problem. I think the reason
others aren't having a problem is because they're using forms.
It doesn't work regardless of whether or not you have cookies on.
In bbb.php it doesn't matter if I call session_start() or
session_register() or both. If I don't call either then there's no
session_id.
It's interesting to change the browser's cookie setting to prompt and
watch what happens, both when you go to the next page as well as when
you just reload either page.
If someone else could try these two files and verify my results I'd
be grateful.
Thanks.
=====> start of aaa.php <=====
<?
$email = "abc";
session_register("email");
?>
<html>
<body>
<? echo("Session id is " . session_id() . "<p>"); ?>
<a href="bbb.php">Continue</a>
</body>
</html>
=====> end of aaa.php <=====
=====> start of bbb.php <=====
<?
/* session_start(); */
session_register("email");
if (! isset($email))
echo("<p>email isn't set.<p>");
else
echo("<p>Your login is $email<p>");
echo("Session id is " . session_id() . "<p>");
?>
<html>
<body>
<?
phpinfo();
?>
</body>
=====> end of bbb.php <=====