A one hour timeout is better controlled with the session.gc_maxlifetime setting. This is the number of seconds after which an inactive session file will be deleted. No session file means no session for the user. Set this at 3600 and if the user is not active for over an hour, the next triggered garbage collection will delete the session file.
Note that the time isn't 100% accurate and is dependent upon traffic. There's a 1% (by default) chance of each request that starts a session will trigger the garbage collection. If you have enough traffic, the garbage collection is triggered enough to make the one hour time limit pretty accurate. On your test server, however, where your the only one hitting the server, garbage collection will not be triggered as much and your session files will last longer.
I tried that on my servers: Tested on the development server and the production server. But It does not work for me.
Must say that I have to change this value by the .htaccess file, as I do not have access to the PHP.INI
The manual says that session.gc_maxlifetime has a default value of "1440" (24 minutes) and can be set on PHP_INI_ALL.
Well, I set session.gc_maxlifetime to 7200 (2 hours), because I need to edit some complex documents on the web.
After 20/25 minutes of inactivity, my session expires. It does not follow the configured 2 hours for garbage collection.
I know I'm missing something, but cannot find out what.
Regards, Jordi.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php