Jump to content

[SOLVED] IE 6 Won't Log Me Out in a SIMPLE Logout Page!?!?


spiceydog

Recommended Posts

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

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;
}
?>

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:8) in /home/muzicwar/public_html/logout.php on line 9

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.