NYCPHP Meetup

NYPHP.org

[nycphp-talk] Session timing out too soon

Aaron Fischer afischer at email.smith.edu
Thu Dec 4 09:12:36 EST 2008


Greetings,

I have an application built for internal use that has a user login and  
then uses sessions to track their state.  I am running into a problem  
in that their session seems to expire if they are on one page for  
somewhere between 15-25 minutes.  This creates a big problem because  
they type up a long report, submit it and then get booted out of the  
application without the report being saved.

I would like to have the user be able to be logged in for a full eight  
hour day, regardless of their level of activity.

How would I do this?  I would appreciate any suggestions.  Also of  
note, I am in a shared hosting environment.

I tried three different solutions without any luck so far:
1) Using session_set_cookie_params() to extend the lifetime of the  
session cookie.
2) Using a javascript function to to periodically call an image to  
simulate page activity.
3) Using ini_set(session.gc_maxlifetime) to set the the number of  
seconds for php to wait before data may be seen as garbage and be  
cleaned up.

Thanks,

-Aaron



More information about the talk mailing list