Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    May 2006
    Posts
    47
    Thanks
    0
    Thanked 0 Times in 0 Posts

    login timeout while editing document

    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!!!

  • #2
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,019
    Thanks
    2
    Thanked 313 Times in 305 Posts
    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.
    Last edited by CFMaBiSmAd; 02-03-2007 at 10:33 PM.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #3
    New Coder
    Join Date
    May 2006
    Posts
    47
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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!!!

  • #4
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    Just to back up CFMaBiSmAd's answer-- I had this same exact problem and it was fixed by forcing my own maxlifetime setting.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •