PHP 4.0 Bug #5134: Session variables not saved when register_globals = Off

From: Date: Mon, 19 Jun 2000 21:51:32 +0000
Subject: PHP 4.0 Bug #5134: Session variables not saved when register_globals = Off
Groups: php.dev 
Request: Send a blank email to php-dev+get-21779@lists.php.net to get a copy of this message
From: bruce@iname.com Operating system: Windows 98 PHP version: 4.0.0 Release PHP Bug Type: Session related Bug description: Session variables not saved when register_globals = Off I'm using Apache 1.3.12/Windows 98/PHP 4.0 release without Zend optimizer. Session variables do not retain their values between page accesses when track_vars = On and register_globals = Off in php.ini. If track_vars is turned off OR register_globals is turned on, sessions work correctly. Here's a sample script: <? session_start(); session_register('counter'); $counter++; echo "<p>You've been here $counter times.</p>"; ?> If track_vars = On and register_globals = Off, the script displays "You've been here 1 times" each time it is run. It appears that the session data file (sess_*) that corresponds with the current session is not written to or read from. If track_vars = Off and register_globals = On, (or if track_vars = On and register_globals = On) the script runs correctly and displays increments the counter each time it is run. Workaround: Make sure that register_globals is turned on in php.ini.

« previous php.dev (#21779) next »