phpretard Posted May 12, 2008 Share Posted May 12, 2008 It seems that when I logout of my site that all of the sessions don't clear. Is thee a way to be 100% sure your sessions are gone? I say this because when I click the Log out button it directs you to the login screen. Well I have to enter my user ans pass twice to get back in every time. session_start(); $_SESSION = array(); session_destroy(); This is what I think does it. Anyone heard of this before...the part about having to log back in twice? Link to comment https://forums.phpfreaks.com/topic/105220-sure-fire-log-out/ Share on other sites More sharing options...
The Little Guy Posted May 12, 2008 Share Posted May 12, 2008 session_start(); $_SESSION = array(); if (isset($_COOKIE[session_name()])) { setcookie(session_name(), '', time()-42000, '/'); } session_destroy(); Link to comment https://forums.phpfreaks.com/topic/105220-sure-fire-log-out/#findComment-538773 Share on other sites More sharing options...
phpretard Posted May 12, 2008 Author Share Posted May 12, 2008 I dont intentionally set cookies does tht mean anything? Link to comment https://forums.phpfreaks.com/topic/105220-sure-fire-log-out/#findComment-538776 Share on other sites More sharing options...
corbin Posted May 12, 2008 Share Posted May 12, 2008 "Well I have to enter my user ans pass twice to get back in every time." That could be a problem with your login page, not your sessions not clearing correctly. It's hard to say without code examples. Link to comment https://forums.phpfreaks.com/topic/105220-sure-fire-log-out/#findComment-538781 Share on other sites More sharing options...
The Little Guy Posted May 12, 2008 Share Posted May 12, 2008 you should still do it, because PHP will automatically make a cookie for you when you use session_start that way it can match the client to the session on the server. Link to comment https://forums.phpfreaks.com/topic/105220-sure-fire-log-out/#findComment-538783 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.