ID: 19022 Comment by: phpbugs at chime dot tv dot cutthis Reported By: phpbugs at mx4k dot com Status: No Feedback Bug Type: Session related Operating System: linux (rh7.3), apache 1.3.26 PHP Version: 4.2.2 New Comment:
I'm losing session variables randomly too. Sometimes I get the "Failed to write..." error but not always. Since I don't host my servers I can't give full server details. However here's a test script on both servers with the relevant PHPInfo: Server A: http://chir.ag/test.php Server B: https://secure.magictanorders.com/test.php Test script: <?php session_cache_expire(30); session_start(); if($_SESSION["test"] == 1) { echo "<center>Sessions work.</center><br><br>"; } else { $_SESSION["test"] = 1; echo "<center>Starting Session... Click refresh to see if the session works or not.</center><br><br>"; } phpinfo(); ?> Basically Server A works ALWAYS and remembers the session for upto 30 minutes. Server B randomly forgets the session in 1 second to 5 minutes. No session on Server B lasts more than 5 minutes. The problem randomly started on Server B yesterday (Apr 1). We thought it was output_buffering (and turned it ON) but that didn't help. Problem was back this morning. The site was working perfectly for 3 weeks before breaking down randomly. If anyone can give any suggestions I will be very thankful. Previous Comments: ------------------------------------------------------------------------ [2004-03-26 16:40:43] guertin at brucemaudesign dot com Ok .. i got my setup working again .. an old bug that I had forgotten the workaround for I added (right before my initial session_start()): session_destroy(); This destroys (presumably) any previous sessions leftover after an older login. Maybe a php bug? Maybe a browser issue? Maybe a bit of both? (I have it set to not use cookies but yet it still does). Perplexing, but hopefully this helps out others that might run into this issue. ------------------------------------------------------------------------ [2004-03-26 16:15:52] guertin at brucemaudesign dot com Experiencing the same problems here... out of the blue. Machine was running beautifully then all of a sudden it stopped. No one can log in. I changed nothing... there was not so much as a shell login on the machine for 30+ days. sessions seem very fragile (as do many things in php lately, it's getting scarier to keep running in production environment). [Fri Mar 26 16:14:04 2004] [error] PHP Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/ websites/sessions) in Unknown on line 0 I've done so far almost everything suggested that worked for others in here, none of it solved the problems. I can tell you that: 1) it's NOT a permissions problem, my user running apache/php has full write access to /tmp 2) it's not required for this user to have a home directory. For those that need to do this to 'fix' the problem, you OS is broken! (complain to your vendors) 3) it works for exactly one session. The first login works fine and it seems that from there on in PHP tries to use the same session ID for everyone ? 4) manually deleting the existing session file allows on single login again after this. Trying to track down more things. Really perplexing as to why/how it stopped working when it ran fine for a 8+ months. ------------------------------------------------------------------------ [2004-03-11 01:05:01] haccel at email dot com After weeks of testing, I have fixed the problem at least for me. The problem is the Zend Optimizer was corrupting/wiping (presumably) the session data. Turning Zend Optimizer off completely fixed the problem. When I turned Zend Optimizer back on and rebooted the session problem was back again, this is the first reproducible action for me so far. Would be interesting to know how many others with this problem have Zend Optimizer running. ------------------------------------------------------------------------ [2004-03-01 20:15:09] stewart dot james at vu dot edu dot au Just started to expience this after a shift to a new server. php 4.3.3 on Debian Sarge I get the error when I return to the site after logging out. Looking at the cookie data the cookie data PHPSESSID is being set to null, which my browser is recording in it's cookie database. Then on return the site attempts to access informaiotn for PHPSESSID=(NULL) which is what I think is causing the problem with this error. Does anyone else see the same problem on their respective sites? Stewart ------------------------------------------------------------------------ [2004-01-21 08:45:26] august24_70 at yahoo dot com I was having the problem on OpenBSD 3.2, Apache 1.3.26, PHP 3.2.3 when running phpBB. I deleted all my cookies and logged back in again and the problem went. I don't use cookies for handling sessions, I pass it in the URL. ie session.use_trans_sid = 1 ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/19022 -- Edit this bug report at http://bugs.php.net/?id=19022&edit=1