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? Quote Link to comment 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(); Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment 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. 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.