|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5134 Session variables not saved when register_globals = Off
Submitted: 2000-06-19 23:51 UTC Modified: 2000-06-19 23:56 UTC
From: bruce at iname dot com Assigned:
Status: Closed Package: Session related
PHP Version: 4.0.0 Release OS: Windows 98
Private report: No CVE-ID: None
 [2000-06-19 23:51 UTC] bruce at iname dot com
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:



	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.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2000-06-19 23:56 UTC] andrei at cvs dot php dot net
When track_vars = On, and register_globals = Off, the session variables
to be saved have to be in $HTTP_SESSION_VARS array.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Feb 05 05:05:50 2023 UTC