DeanWhitehouse Posted April 24, 2008 Share Posted April 24, 2008 how long do sessions usually last? Or do they never time out? Quote Link to comment https://forums.phpfreaks.com/topic/102801-solved-session-time/ Share on other sites More sharing options...
wildteen88 Posted April 24, 2008 Share Posted April 24, 2008 Sessions last as long as the browser is kept open or until it exceeds the time limits set by session.cookie_lifetime setting. Quote Link to comment https://forums.phpfreaks.com/topic/102801-solved-session-time/#findComment-526564 Share on other sites More sharing options...
dptr1988 Posted April 24, 2008 Share Posted April 24, 2008 Sessions should last for session.gc_maxlifetime or when the user closes his browser Quote Link to comment https://forums.phpfreaks.com/topic/102801-solved-session-time/#findComment-526566 Share on other sites More sharing options...
wildteen88 Posted April 24, 2008 Share Posted April 24, 2008 Sessions should last for session.gc_maxlifetime or when the user closes his browser session.gc_maxlifetime is to do with Garbage Collection which will only affect expired sessions. Quote Link to comment https://forums.phpfreaks.com/topic/102801-solved-session-time/#findComment-526567 Share on other sites More sharing options...
dptr1988 Posted April 24, 2008 Share Posted April 24, 2008 Opps! Thanks for pointing that out. Quote Link to comment https://forums.phpfreaks.com/topic/102801-solved-session-time/#findComment-526570 Share on other sites More sharing options...
PFMaBiSmAd Posted April 24, 2008 Share Posted April 24, 2008 The only thing that updates a session data file's access "timestamp" is a request to a page that contains a session_start(). So, even if someone visits a page and leaves the page displayed in his browser, his session data file, and the session, will be deleted when garbage collection runs and his last access to that file is more than session.gc_maxlifetime ago. Quote Link to comment https://forums.phpfreaks.com/topic/102801-solved-session-time/#findComment-526581 Share on other sites More sharing options...
DeanWhitehouse Posted April 24, 2008 Author Share Posted April 24, 2008 o rite, because i closed a page i made when i was logged in, and went back to it after ten minutes and i was still logged in. How can i make it so when they close the page, the session is ended. Quote Link to comment https://forums.phpfreaks.com/topic/102801-solved-session-time/#findComment-526586 Share on other sites More sharing options...
dptr1988 Posted April 24, 2008 Share Posted April 24, 2008 You can't unless you use AJAX. The server doesn't know when you close your browser window. Quote Link to comment https://forums.phpfreaks.com/topic/102801-solved-session-time/#findComment-526588 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.