Re: Session Expiration Timeout

From: Date: Wed, 28 Jul 2004 23:01:59 +0000
Subject: Re: Session Expiration Timeout
References: 1 2  Groups: php.general.es 
Request: Send a blank email to general-es+get-50553@lists.php.net to get a copy of this message
Matt M. wrote:
I've been looking for about changing somewhere the session exiration time, but only found about the session cookie expiration.
- Wich is the default timeout for a session? And, is some way to know the expiration time for a session?
Take a look at the ini variables. http://us2.php.net/session session.gc_maxlifetime
Well, I tried to test that in my shared WebHosting and it does not work. I've included the directive on my .htaccess file: php_value session.gc_maxlifetime 7200 Tested with phpinfo() to see the value was really set when I enter my site. And it shows the correct value: 7200 (=2 Hours). Then, I've logged into the site to test, worked around for some minutes and leaved the browser opened at any site page (A page with session_start() at the begining). Checked the time ... After 35/40 minutes, I followed any link on the page and ... the session has *expired* and I get the login box. This Site is Runing on Linux With Apache 1.3 and PHP 4.3.8 I cheched also the session cookie expiration, and it's set to 0 (End of session, when the browser expires). Checked the cookie by looking at his info in my browser (Firefox) and the cookie info is set correctly. I've looked again in the *manual*. And it states : _session.gc_maxlifetime_ specifies the number of seconds after which data will be seen as 'garbage' and cleaned up. _Note:_ If you are using the default file-based session handler, your filesystem must keep track of access times (atime). [snip] Since PHP 4.2.3 it has used mtime (modified date) instead of atime. So, you won't have problems with filesystems where atime tracking is not available. Perhaps there is something I cannot see there ... Regards, Jordi Canals

« previous php.general.es (#50553) next »