DeanWhitehouse Posted April 24, 2008 Share Posted April 24, 2008 how long do sessions usually last? Or do they never time out? 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. 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 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. 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. 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. 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. 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. Link to comment https://forums.phpfreaks.com/topic/102801-solved-session-time/#findComment-526588 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.