Jump to content

session forever


calmchess

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

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.