Jump to content

Recommended Posts

Hi All,

 

Can anybody tell me why my session id is always different when i will close the browser.

 

I'm developing a site, actually functionality to count all unique opened sessions within 24h. As i mentioned my problem is when i close my browser, open again and goto site my session id is automatically regenerated with new (i'm expecting the old one).

 

Can anybody help me?

 

thanks

Link to comment
https://forums.phpfreaks.com/topic/240471-session-id-question/
Share on other sites

The reason a server side session is named that is because they are intended to last for the duration of ONE browser session. By default, the session id cookie has a zero lifetime setting and it does not persist once all instances of the browser have been closed. To get a session to persist when the browser is closed, you must both set the session id cookie lifetime setting to some value and you must must extend the session garbage collection setting by the same amount so that the corresponding session data files won't get deleted. On a shared web host, you must also store the session data files in your own private folder so that garbage collection running due to other accounts don't delete your older session data files.

Link to comment
https://forums.phpfreaks.com/topic/240471-session-id-question/#findComment-1235147
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.