Asperon Posted July 30, 2007 Share Posted July 30, 2007 how do you destroy a session when the user leaves the website, or closes the browser etc Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted July 30, 2007 Share Posted July 30, 2007 http://www.php.net/session_destroy Quote Link to comment Share on other sites More sharing options...
Asperon Posted July 30, 2007 Author Share Posted July 30, 2007 I had already look at that, I just don't understand what is going...I understand most of sessions, I can get it all going with a log out button, but I don't understand how to end a session when the user navigates away. Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted July 30, 2007 Share Posted July 30, 2007 If they just navigate away, you can't do anything...you can set the expire time for the session to something rather low, but then if they are reading an article or something, and they're a slow reader, they could get logged out. Â If they close the browser, it will destroy the cookie, and consequentially the session. Quote Link to comment Share on other sites More sharing options...
Asperon Posted July 30, 2007 Author Share Posted July 30, 2007 thank you, I am not using cookies I am just using session variables... or are they the same or similar, thank you.. Quote Link to comment Share on other sites More sharing options...
Asperon Posted July 30, 2007 Author Share Posted July 30, 2007 alright it works the way I want it to for the most part now, thank you Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted July 30, 2007 Share Posted July 30, 2007 The user's session (which one belongs to them) is tracked via a cookie, unless you explicitly turn that action off in php.ini. 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.