Jump to content

Recommended Posts

By default, sessions end when the browser is closed (because the session id cookie has a zero life time) or when session garbage collection removes the corresponding session data file on the server.

 

Sessions are only designed to last for the length of one browser session. Why do you want to make a session last longer because there are probably better solutions available than using a session (forever is a little beyond what is possible anyway, though it is possible to make one last until 19 Jan 2038.)

Link to comment
https://forums.phpfreaks.com/topic/199963-session-forever/#findComment-1049532
Share on other sites

So are you saying that your code works most of the time but occasionally while someone in on a page and go to a different page or refresh the current page that the session no longer exists?

 

If so, then the most likely cause is -

 

when session garbage collection removes the corresponding session data file on the server.

 

Could you provide a estimate of how much time passes (i.e. 24 minutes) before this occurs and are you on a shared web server?

 

 

Link to comment
https://forums.phpfreaks.com/topic/199963-session-forever/#findComment-1049548
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.