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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
41 - 12 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 21:01:27 2024 UTC