Jump to content

Session ID question


dime_f

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

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.