php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33130 Odd behavior with session handling
Submitted: 2005-05-24 19:29 UTC Modified: 2005-05-25 14:33 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: steve at gamesareforchildren dot com Assigned:
Status: Not a bug Package: Session related
PHP Version: 5.0.4 OS: Windows XP SP2, all updates
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: steve at gamesareforchildren dot com
New email:
PHP Version: OS:

 

 [2005-05-24 19:29 UTC] steve at gamesareforchildren dot com
Description:
------------
After spending 25 hours over three days reading through thousands of websites and attempting every configuration change imaginable, including downgrading PHP and Apache and then re-upgrading, I can only conclude that this issue is a bug.

Look at the files provided and try out the forms.  In most cases, the session data is not carried across pages.  session_start() is being called in all instances.  Files are indeed being created in the directory specified in php.ini, but they also contain only the data from the most recent page; it's as if the old data is somehow being lost.  Yet, in Firefox, at least, I can see that a PHPSESSID cookie has been created, yet the data displayed in the browser is still incorrect.

The only clue I got was that this issue might have something to do with virtual hosts, but I spent three hours on that alone and was unable to resolve the problem; disabling virtual hosts is not an available solution.  The problem did not arise until I purchased and configured an additional domain name for this server.

Here are some additional statistics if they are of use:

OS:  Windows XP SP2, all available updates installed
PHP:  version 5.0.4 (downgrade fails to fix problem)
Apache:  version 2.0.54 (downgrade fails to fix problem)
Other applications running:  RealVNC, WinWebMail E-Mail server, Activeworlds world server software, and IIS 5 (on port 81)
Router problems are not an issue, because I set this computer as the DMZ.

Reproduce code:
---------------
http://www.shoemakervillage.org/20.html

Code is located at http://www.shoemakervillage.org/20.txt, http://www.shoemakervillage.org/21.txt

PHP INI is at http://www.shoemakervillage.org/php.ini
httpd.conf is at http://www.shoemakervillage.org/httpd.conf

Expected result:
----------------
Array will not contain session variables brought over from previous pages.  In IE, the array will sometimes contain previous variables.  In Firefox, the array never contains previous variables.  Tested using web browsers from three systems.

Actual result:
--------------
Array ( [Surname] => Steve2 [Submit] => Submit )

"Name" is not contained in the array.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-05-24 19:31 UTC] steve at gamesareforchildren dot com
I misunderstood what "expected result" meant.  If things were working correctly, the array would contain all the variables, even from previous pages.  In reality, it contains only variables added to the session array in the current page.
 [2005-05-24 23:55 UTC] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.

I get 404 Not Found for both URLs.
Also, set session.use_trans_sid On and try again.
 [2005-05-25 00:22 UTC] steve at gamesareforchildren dot com
Oops, sorry - I specified the wrong directory.

The correct locations for the files are:

http://www.shoemakervillage.org/cd/20.html

http://www.shoemakervillage.org/cd/20.php
http://www.shoemakervillage.org/cd/21.php

I also forgot to mention about the trans_sid setting - I tried it a while ago.  Unfortunately, it did nothing - my understanding was that the ID would be contained in the URL.  Even with it set to 1 and use_cookies set to zero, it must have still been using cookies because no URL identifier was included.

Also, I spent another few hours thinking there was still something obvious I overlooked, and set up PHP for the IIS server.

You can try that one out at http://www.shoemakervillage.org:81/php/20.html.  The source is the same as on the Apache server.  I get similarly unpredictable results - but interestingly I discovered that on both installations if I pressed "Back" after getting to 21.php, the print_r command on 20.php would print out all three values.  If I then tried to re-enter the "Surname" value into 20.php, the "Name" value would again disappear.

Hope this helps,

-Steve
 [2005-05-25 11:01 UTC] sniper@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

There is no bug. You're just doing something wrong (and as we didn't get any SHORT example script -> bogus)

 [2005-05-25 14:33 UTC] steve at gamesareforchildren dot com
What the heck?  How short does an "example script" have to be?  The files I gave you were six lines total!  The least you could do is look at them.

If the support channels were going to provide an explanation for me, they would have 30 hours ago.

I've already started rewriting in ASP.  I don't see why I ever bothered to waste so much time writing this long description.

Good luck,

-Steve
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 23:01:28 2024 UTC