crazy8 Posted January 31, 2007 Share Posted January 31, 2007 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? Quote Link to comment Share on other sites More sharing options...
Jessica Posted January 31, 2007 Share Posted January 31, 2007 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 Quote Link to comment Share on other sites More sharing options...
crazy8 Posted January 31, 2007 Author Share Posted January 31, 2007 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 Quote Link to comment Share on other sites More sharing options...
Jessica Posted January 31, 2007 Share Posted January 31, 2007 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? Quote Link to comment Share on other sites More sharing options...
crazy8 Posted January 31, 2007 Author Share Posted January 31, 2007 Ooooooooooh ok, well you got me there. i am closing the tabs in firefox ::) Quote Link to comment 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.