Bug #9583 Updated: session variables not kept when using $HTTP_SESSION_VARS and register_globals

From: Date: Tue, 12 Jun 2001 21:16:17 +0000
Subject: Bug #9583 Updated: session variables not kept when using $HTTP_SESSION_VARS and register_globals
Groups: php.dev 
Request: Send a blank email to php-dev+get-57182@lists.php.net to get a copy of this message
ID: 9583 Updated by: sniper Reported By: sander@rotzorg.org Old-Status: Feedback Status: Closed Bug Type: *Session related Operating system: PHP Version: 4.0.4pl1 Assigned To: Comments: No feedback and should be fixed. Reopen if not workie with PHP 4.0.6. --Jani Previous Comments: --------------------------------------------------------------------------- [2001-05-22 21:06:52] sbergmann@php.net Please give the latest CVS a try. Andrei Zmievski committed a patch that should fix this problem. --------------------------------------------------------------------------- [2001-03-06 11:36:00] sander@rotzorg.org 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 --------------------------------------------------------------------------- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=9583&edit=2

« previous php.dev (#57182) next »