php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16585 Use of $_SESSION to set variable doesn't save variable
Submitted: 2002-04-13 06:50 UTC Modified: 2002-05-14 00:00 UTC
Votes:5
Avg. Score:5.0 ± 0.0
Reproduced:5 of 5 (100.0%)
Same Version:4 (80.0%)
Same OS:2 (40.0%)
From: cedric dot dufour at cogito-ergo-soft dot com Assigned:
Status: No Feedback Package: Session related
PHP Version: 4.1.2 OS: Windows XP
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 — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
24 - 8 = ?
Subscribe to this entry?

 
 [2002-04-13 06:50 UTC] cedric dot dufour at cogito-ergo-soft dot com
Following the 'Session handling' documentation and expriencing problems with a production script, I wrote the following test script:

test.php:
<?php
session_start();
echo "Session ID : ".session_id()."<BR>\r\n";
if( !isset( $_SESSION['Test'] ) )
{
	$_SESSION['Test'] = "bla bla bla";
	echo "Defined : ".$_SESSION['Test']."<BR>\r\n";
}
else
{
	echo "Existing : ".$_SESSION['Test']."<BR>\r\n";
}
//session_write_close();
?>

which I expect to set the 'Test' session variable on the first call to the page and then return the 'Test' session variable on subsequent calls to the script.

This works FINE with PHP 4.1.1 but DOES NOT WORK with PHP 4.1.2 (though the session ID is the same). I had to revert to the old 'session_register()' function for the script to work in PHP 4.1.2, $HTTP_SESSION_VARS not working either.

Any clue ?

Ce.D

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-13 14:11 UTC] sniper@php.net
It's propably the same issue as everyone else is having.
Please try the PHP 4.2.0RC3 from http://www.php.net/~derick/
as others have reported that it works fine for them.

And don't forget to replace the php4ts.dll in your system
with the one in the 4.2.0RC3 package.

 [2002-05-14 00:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2003-03-06 05:07 UTC] sean at seansilas dot com
This bug is EXTREMELEY ANNOYING, and very hard to replicate. Sometimes it happens, other times it doesn't. Seems to happen more when the server has been idle for awhile.

The big problem here, is that I cannot upgrade my PHP, because I am using a remote hosting company that has 4.1.2 installed.

I have no idea what to do, and I'm extremely frustrated.

SS
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 13:01:30 2024 UTC