Jump to content

Ending a session


crazy8

Recommended Posts

Ok now that I have a pretty much working sessions script, ont thing I dont like is how long the sessions are held so is there a way I can set up the session to expire as soon as browser is closed or by a set amount of time? If so how would i do this?
Link to comment
Share on other sites

Sessions do expire when the browser closes.
They default to 30 minutes of inactivity. If you want it to only last a certain amount of time regardless of user activity, when the session starts save the timestamp, and on every page check if it's been past your time. If it has, close the session and log them out.
http://us2.php.net/session
Link to comment
Share on other sites

Well maybe im not asking the right question or asking it the right way. I guess whats going on is that right now since im still writing up code for my project and testing stuff out (on a serverin the building) I will test out my form which uses the sessions and then when im done I will close the browser and even a few minutes later ill go back to the page and everything I had entered is still there. So i guess thats what I want to get rid of. As soon as i close browser and eventualy open again to have a new page not one displaying all the data I entered the time before. Does this make sence? ;D I probably just confused you more..lol
Link to comment
Share on other sites

Are you closing the browser entirely, or using Firefox and closing tabs? You have to close the entire browser.
Perhaps you are caching the pages. Next time you go to the page, and it looks like the session is still there, hold down SHIFT and hit your refresh button. (This is a cache-clear refresh).

If none of this helps, can you post a link, let me try it?
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.