php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: bruce at iname dot com
New email:
PHP Version: OS:

 

 [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:

<?
	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.

Patches

Pull Requests

History

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-2025 The PHP Group
All rights reserved.
Last updated: Tue May 13 12:01:27 2025 UTC