roadshow Posted November 26, 2007 Share Posted November 26, 2007 I'm using the login script from here. Logging out in firefox works fine. In IE, it doesn't log you out, however. It says "logged in as gone" and you have to manually delete all cookies in the browser. Here's the log out code: <?php $past = time() - 100; //this makes the time in the past to destroy the cookie setcookie(ID_my_site, gone, $past); setcookie(Key_my_site, gone, $past); header("Location: login.php"); ?> IE reads that "gone" as a user. It doesn't work in any browser if the gone is removed. Any ideas? Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted November 26, 2007 Share Posted November 26, 2007 Try putting quotes around "gone" setcookie(ID_my_site, 'gone', $past); setcookie(Key_my_site, 'gone', $past); Quote Link to comment Share on other sites More sharing options...
revraz Posted November 26, 2007 Share Posted November 26, 2007 setcookie("ID_my_site", "gone", $past); Quote Link to comment Share on other sites More sharing options...
roadshow Posted November 26, 2007 Author Share Posted November 26, 2007 Hmm. It's still doing it. Quote Link to comment Share on other sites More sharing options...
toplay Posted November 26, 2007 Share Posted November 26, 2007 1) It's up to the browser of how and when to delete the cookie. You can't control it from PHP (especially with IE). IE tends to delete cookies when the browser is closed and not right after a setcookie() is invoked. 2) The time in the past should be set back at least a day or more and not just 300 seconds. You're assuming the time on the client machine is the same as your server. Their clock could be set to anything (in which case the cookie may not get deleted). 3) You're not showing us all your code of how you're using the cookie. In any case, I would suggest you use PHP sessions rather than just relying on cookies alone. http://us2.php.net/manual/en/function.setcookie.php 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.