php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19029 Session data randomly disappearing and logging users out
Submitted: 2002-08-21 21:34 UTC Modified: 2002-10-14 19:26 UTC
Votes:17
Avg. Score:4.6 ± 0.6
Reproduced:14 of 14 (100.0%)
Same Version:2 (14.3%)
Same OS:7 (50.0%)
From: rossr at reactive dot com Assigned:
Status: No Feedback Package: Session related
PHP Version: 4.2.2 OS: Linux (2.4 Kernal)
Private report: No CVE-ID: None
 [2002-08-21 21:34 UTC] rossr at reactive dot com
For the most part our sessions work fine. However at random times the session data appears to just disappear and the user is logged out. They can then log straight back in no problems and create a new session.

Due to it's random nature this is really hard to track down and provide anything that can replicate it. It happens across different browsers and platforms.

PHP is running as the CGI version with Apache/1.3.19 (Unix) and the site has FrontPage/5.0.2.2510 extensions.

The session settings for our PHP.ini file is as follows:

Directive 		    Local Value Master Value 
=========================== =========== ==============
session.auto_start	 	Off 		Off 
session.cache_expire	 	180 		180 
session.cache_limiter	 	nocache 	nocache 
session.cookie_domain	 	no value 	no value 
session.cookie_lifetime	 	0 		0 
session.cookie_path	 	/ 		/ 
session.cookie_secure	 	Off 		Off 
session.entropy_file	 	no value 	no value 
session.entropy_length	 	0 		0 
session.gc_maxlifetime	 	1440 		1440 
session.gc_probability	 	1 		1 
session.name			PHPSESSID 	PHPSESSID 
session.referer_check	 	no value 	no value 
session.save_handler	 	files 		files 
session.save_path		/tmp 		/tmp 
session.serialize_handler	php 		php 
session.use_cookies		On 		On 
session.use_trans_sid		1 		1 


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-08-22 07:27 UTC] phpbugs at mx4k dot com
hi, try to turn on error logging to a file in php.ini. I'm experiencing the same problem and my logfile is filled with:

[22-Aug-2002 13:24:08] PHP Warning:  Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0
[22-Aug-2002 13:24:29] PHP Warning:  Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0
[22-Aug-2002 13:24:40] PHP Warning:  Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0


http://bugs.php.net/bug.php?id=19022
 [2002-08-22 07:43 UTC] sander@php.net
Dupe of #19022.
 [2002-09-26 12:09 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-latest.zip


 [2002-10-14 19:26 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".
 [2002-10-18 03:32 UTC] ivo at ibuildings dot nl
[18 Oct 3:29am] ivo@ibuildings.nl

I'm experiencing this too, and I might have some usefull feedback!

I don't see the 'failed to write' messages. But I do have the random
loss of sessions. I've modified my script so I get an email with all
GET_VARS, SERVER_VARS etc. whenever the sessiondata is lost.

I found a very weird thing with respect to the session cookie. It
contained:

HTTP_COOKIE          = 1; PHPSESSID=f1faf3374d562e8738f64e7e7e030972;
pollvoted[1]=1;  (... some other data left out for privacy reasons);
PHPSESSID=842be4994a9c424fd7d4f9f8049aadc9

There are two separate PHPSESSID's in the same cookie! Maybe one of the
too is indeed invalid (no session date) How is this possible?

(I originally submitted this comment to bug 19022, but this bug is probably a better place)
 [2003-07-08 02:15 UTC] wieri420 at planet dot nl
POSSIBLE SOLUTION:
I had exactly the same problem..

After nearly 2 month of being frustrated a friend of mine discovered the problem.

The cause of it was that I used sessions AND cookies in one script. 
I commented all the 'setcookie' lines and all other cookie functions in my script and .... the problem vanished!!

So if you have this problem check your use of cookies and sessions in one script..
I recommend to use only session variables if possible.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Nov 22 18:01:31 2024 UTC