spiceydog Posted July 16, 2008 Share Posted July 16, 2008 I don't use IE at all so when I finally decided to test my website in IE I almost chuched my keyboard at the monitor... Most things work but the Logout page doesn't!? Here is my logout page (which works PERFECTLY in Opera, Safari, and Firefox): <?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: index.php"); ?> What goes wrong: It just refreshes the page basically. It takes you to the page logout.php, ignores all of the setcookie commands, and redirects you back to index.php still logged in. Remember, I am using IE 6 not 7 so I don't know if this works in 7 however I am not willing to download that laggy peica ****... lol Link to comment https://forums.phpfreaks.com/topic/114988-solved-ie-6-wont-log-me-out-in-a-simple-logout-page/ Share on other sites More sharing options...
Bendude14 Posted July 16, 2008 Share Posted July 16, 2008 i guess you are using sessions as well? try this <?php // invalidate the session cookie if (isset($_COOKIE[session_name()])) { setcookie(session_name(), '', time()-86400, '/'); } // end session and redirect session_destroy(); header('Location: login.php'); exit; } ?> Link to comment https://forums.phpfreaks.com/topic/114988-solved-ie-6-wont-log-me-out-in-a-simple-logout-page/#findComment-591363 Share on other sites More sharing options...
spiceydog Posted July 16, 2008 Author Share Posted July 16, 2008 Thanks! But now I'm getting this error when I use your script: Warning: session_destroy() [function.session-destroy]: Trying to destroy uninitialized session in /home/muzicwar/public_html/logout.php on line 8 Warning: Cannot modify header information - headers already sent by (output started at /home/muzicwar/public_html/logout.php: in /home/muzicwar/public_html/logout.php on line 9 Link to comment https://forums.phpfreaks.com/topic/114988-solved-ie-6-wont-log-me-out-in-a-simple-logout-page/#findComment-591373 Share on other sites More sharing options...
waynew Posted July 16, 2008 Share Posted July 16, 2008 Maybe <?php session_start(); $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: index.php"); ?> Link to comment https://forums.phpfreaks.com/topic/114988-solved-ie-6-wont-log-me-out-in-a-simple-logout-page/#findComment-591378 Share on other sites More sharing options...
Bendude14 Posted July 16, 2008 Share Posted July 16, 2008 do you have session_start(); at the top of your page? Link to comment https://forums.phpfreaks.com/topic/114988-solved-ie-6-wont-log-me-out-in-a-simple-logout-page/#findComment-591400 Share on other sites More sharing options...
waynew Posted July 16, 2008 Share Posted July 16, 2008 He didn't. Link to comment https://forums.phpfreaks.com/topic/114988-solved-ie-6-wont-log-me-out-in-a-simple-logout-page/#findComment-591403 Share on other sites More sharing options...
spiceydog Posted July 16, 2008 Author Share Posted July 16, 2008 thank you Link to comment https://forums.phpfreaks.com/topic/114988-solved-ie-6-wont-log-me-out-in-a-simple-logout-page/#findComment-591410 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.