Re: Session expires randomly

From: Date: Fri, 02 Sep 2005 17:11:16 +0000
Subject: Re: Session expires randomly
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-221767@lists.php.net to get a copy of this message
On Fri, 2 Sep 2005, Mauricio Pellegrini wrote:
Hi, I have this problem , When I start a Session everything seems to be ok but sometimes with no reason the session vanishes. I'm using PHP 4.3.4 as a Apache module. Apache version is 1.3 under Suse Linux 8.2 All settings are default , I mean session_cache_expire is 180 min. I understand that this setting should make sessions last for at least 3 hours but in my case it seems not to be true since the real duration varies from 20 minutes to an hour I use session_start() and then on any routine I verify the existence of certain session variables. Is the server expiring the session automatically for some reason?
Just a thought... normal file based sessions are stored in /tmp. Maybe your server has some process that is cleaning out files in /tmp that haven't been accessed in X amount of time.. Crazy thought, but maybe that's it... Try some tests... start a session, load a page, and have the page reload itself every minute (being sure to access/modify the session). Put some code in there so as soon as the session goes away it spits out the date/time and stops so you can see how long it lasted. Let that run for over an hour. See what happens. Try another one, but only reload the page every 20-30 minutes or something... good luck!

« previous php.general (#221767) next »