Jump to content

session expiring after a couple hours...please help!


mcerveni

Recommended Posts

So I have a website that over 80 users access throughout the day. They are logged in for a 9 hour shift.

When i first launched the site, after about 3.5 - 4 hours, the session expired and logged them out.

Now, after a week of it being used..after an hour the session expires, becomes blank, and the user has to log out again.

 

I have this on the top of my header include file:

 

session_start();

 

ini_set("session.cookie_lifetime", 86400);

 

i now changed that to:

 

ini_set('session.gc_maxlifetime', 86400);

 

so i hope this will work...

 

any suggestions??

 

 

 

Setting any of the session settings after the session_start() has no effect. They must be set before the session start and they must be set before every session_start. It is best and simpler to globally set them in the master php.ini (when you have access to it), in a .htaccess file (when php is running as an Apache Module), or in a local php.ini (when php is running as a CGI appliction.) If you are on a shared web server you must also set the session.save_path to be to a private folder within your account's folder tree so that your session data files will only be affected by your session settings.

 

The session.cookie_lifetime only has an effect if the browser is completely closed. If the browser is kept open (even if none of the windows/tabs are a page on your site), it has no effect.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.