PHP 4.0 Bug #9583: session variables not kept when using $HTTP_SESSION_VARS and register_globals
| From: | sander at rotzorg dot org | Date: | Tue, 06 Mar 2001 16:36:00 +0000 |
| Subject: | PHP 4.0 Bug #9583: session variables not kept when using $HTTP_SESSION_VARS and register_globals | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-48066@lists.php.net to get a copy of this message | ||
From: sander@rotzorg.org
Operating system: Debian GNU stable with unstable php and apache packages
PHP version: 4.0.4pl1
PHP Bug Type: *Session related
Bug description: session variables not kept when using $HTTP_SESSION_VARS and register_globals
Hi,
i have this (sample) script:
<?php
session_name("gpixsessid");
session_start();
if (!session_is_registered("totalscore")) {
session_register("totalscore");
$totalscore = 0;
// $HTTP_SESSION_VARS["totalscore"] = 0;
} else {
// $HTTP_SESSION_VARS["totalscore"] += 10;
$totalscore += 10;
}
$line = session_id() . "<br>\nScore:" . $totalscore;
//$line = session_id() . "<br>\nScore:" .
$HTTP_SESSION_VARS["totalscore"];
?>
<html>
<body>
<?php echo $line ?>
</body>
</html>
If register_globals is On, everything works fine using the $totalscore global. But, if you change
the comments, and use $HTTP_SESSION_VARS[] the sessiondata (totalscore) stays undefined.
If i change register_globals to Off (and restarting apache), the globals (surprise) don't work
anymore, but $HTTP_SESSION_VARS do.
This is in contrast with the manual, saying that if register_globals is On, both $HTTP_SESSION_VARS
and the global reference the same value.
gr,
Sander De Graaf
--
Edit Bug report at: http://bugs.php.net/?id=9583&edit=1