Jump to content

Sessions expire althought I set them to indefinite


mesh2005

Recommended Posts

I checked the PHP configuration and I can see the session timeout is set to never expire, however; sometimes my application fails to read the Session variables. I keep a logged-in flag in the Session but it is empty after a while. I have to logout and re-login, please advice.

Thank you

AM

Link to comment
Share on other sites

Also post the name of the setting you are talking about.

 

Sessions are designed to hold data for the duration of one visit to your site. While you can set the session.cookie_lifetime and the session.gc_maxlifetime (requires you to set session.save_path to a private folder if you are on a shared server) to cause sessions to last as long as you want, you should be using a regular cookie to identify a visitor between visits to your site.

 

Your session problem could be due to someone else on a shared severs using a short session.gc_maxlifetime or just the default session.gc_maxlifetime logging your visitors out by deleting the session data file if they are stay on one page for that amount of time or it could be due to a problem with one of your pages outputting content before the headers are sent.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.