anujphp Posted December 16, 2008 Share Posted December 16, 2008 hello guys i need the code of loging out session when someone close he browser..in php THANKS IN ADVANCE Quote Link to comment https://forums.phpfreaks.com/topic/137161-solved-how-to-log-out-session-automatically-when-browser-is-closed/ Share on other sites More sharing options...
blueman378 Posted December 16, 2008 Share Posted December 16, 2008 ah if your login doesnt use cookies then your login should logout as sessions are destroyed when the browser is closed. if it uses cookies simply set the time on the on the cookie to a past itme Quote Link to comment https://forums.phpfreaks.com/topic/137161-solved-how-to-log-out-session-automatically-when-browser-is-closed/#findComment-716485 Share on other sites More sharing options...
anujphp Posted December 20, 2008 Author Share Posted December 20, 2008 THANK YOU I am using session..what you ahve said does that means when the browser is closed all the session varaible will be destroyed. Quote Link to comment https://forums.phpfreaks.com/topic/137161-solved-how-to-log-out-session-automatically-when-browser-is-closed/#findComment-720207 Share on other sites More sharing options...
jrws Posted December 20, 2008 Share Posted December 20, 2008 Yes Quote Link to comment https://forums.phpfreaks.com/topic/137161-solved-how-to-log-out-session-automatically-when-browser-is-closed/#findComment-720213 Share on other sites More sharing options...
anujphp Posted December 21, 2008 Author Share Posted December 21, 2008 THANK YOU GUYS.... MY PROBLM IS SOLVED.... Thanks once again Quote Link to comment https://forums.phpfreaks.com/topic/137161-solved-how-to-log-out-session-automatically-when-browser-is-closed/#findComment-720600 Share on other sites More sharing options...
redarrow Posted December 21, 2008 Share Posted December 21, 2008 That not true, Not all session's destroy after the browser is closed, Example. If you got the life off the session set in php.ini for a long time then it is passable that the session is still set. you need to set this in the php.ini to the time you want the session's to die. session.gc_maxlifetime=set this is seconds to die for all sessions in the php.ini It defiantly possible having session.gc_maxlifetime set to long cheek. Quote Link to comment https://forums.phpfreaks.com/topic/137161-solved-how-to-log-out-session-automatically-when-browser-is-closed/#findComment-720630 Share on other sites More sharing options...
blueman378 Posted December 21, 2008 Share Posted December 21, 2008 but then how many servers in 1000 would have it set to that long? Quote Link to comment https://forums.phpfreaks.com/topic/137161-solved-how-to-log-out-session-automatically-when-browser-is-closed/#findComment-720675 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.