View Full Version : login timeout while editing document

02-03-2007, 10:11 PM
Hello all,

I have a user system set up ussing sessions. Each page looks to see whether the user is logged in. I have the cookies set to expire when the browser is closed but some users have been reporting that they have been logged out after a while without closing a browser.

My question is this. A user may be writing a document for an extended period. If they try to submit and their session has expired, they lose the document they have spent time on. What is the best method of sort of "parking" the information in case they need to login again, then redirecting them back to the page with their proper data?

any help would be appreciated greatly. Thanks!!!

02-03-2007, 10:24 PM
This is usually caused by the session data file garbage collection running on servers with a lot of session_start() statements and deleting session data files older than the session garbage collection maxlifetime (the default is 1440 seconds.) Garbage collection runs, using the default settings, every 1000 session_start() statements.

If this is on a shared server and someone is using a shorter maxlifetime or more frequent garbage collection run settings, then the shortest/more frequent running will win.

Edit: If this is on a shared server, the best fix for this is to set your own session.save_path so that when gc runs due to other scripts, that your session files don't get deleted.

02-14-2007, 05:48 AM
Thanks for the explanation...and sorry for the delayed response- subscription to the thread wasn't working.

I'll give your suggestion a try.

I very much appreciate your help!!!

02-14-2007, 03:41 PM
Just to back up CFMaBiSmAd's answer-- I had this same exact problem and it was fixed by forcing my own maxlifetime setting.