Jump to content

Strange Session Behavior


Gazzski

Recommended Posts

Hi,

I am currently experiencing some problems with sessions and I thought someone here might have had the same problem in the past and could point me in the right direction.

I use my session to store a few simple variable values and under normal circumstances the session works fine and I can access my variables as I move from page to page. However, I have my session.cookie_lifetime setting set to zero so that the session should not expire until the browser closes. This all works fine but what I want to do is extend the timeout of inactivity because my sessions were being destroyed after roughly 24 minutes (the default garbage collection lifetime setting I believe). So, I have also temporarily set my garbage collection lifetime value to 10 hours (for testing purposes) and this is where things get strange for me. My session seemed to be timing out after the same period of inactivity even though I used ini_get to double check that the garbage collecxtion max lifetime is set to 10 hours. On closer inspection I discovered that perhaps my session was not expiring but the variables stored in them becoming lost or garbage collected for some reason. You see, when I leave a page for about 30 minutes and then refresh, I am redirected back to my Login screen indicating that the session variable 'LoggedIn' has somehow become unset (as with all my other session variables). However, when I print out the session id, it is still the same as before the period of inactivity. So it seems to me as if the session is still alive but the variables that were registered with it have become lost (either that or a new session was created with the exact same ID which seems unlikely to me).

Any help you guys might have to offer would be greatly appreciated.

Thanks
Link to comment
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.