Re: session / garbage collection problem
| From: | Tony Crockford | Date: | Fri, 19 Dec 2003 23:23:48 +0000 |
| Subject: | Re: session / garbage collection problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-173051@lists.php.net to get a copy of this message | ||
On Fri, 19 Dec 2003 13:37:06 -0800, Anthony Kaufman wrote:
PHP Version 4.2.2 Apache 2 RH 9 The problem is that session files in the /tmp directory are completely cleared out at "random" intervals of time. We assume that the randomness is due to our session.gc_probability setting of "1" causing it to run for 1% of new sessions. What we don't understand is why the garbage collector is removing valid sessions. session.gc_maxlifetime is set to 86400 (24 hours) so it should keep them around for a good long time. However, it seems that ALL session files are deleted when the garbage collector runs. In some cases session files were deleted for sessions that had been around for less than a minute. We've thought of several hacks that would control the problem but we can't come up with any way to fix it.I'd be interested to hear of the hacks.. I've got a hosted application that has started losing session state since they upgraded PHP and they're blaming me and I know it isn't because I have the same spec locally and the same script on different servers. is there something I can add to my script or in an htaccess file to keep my sessions away from their garbage collection, as it seems likely that I have a similar situation to you. TIA Tony