dime_f Posted June 26, 2011 Share Posted June 26, 2011 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 Quote Link to comment https://forums.phpfreaks.com/topic/240471-session-id-question/ Share on other sites More sharing options...
PFMaBiSmAd Posted June 26, 2011 Share Posted June 26, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/240471-session-id-question/#findComment-1235147 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.