I have a logout script like this:
<?php
require 'core.php';
$_SESSION = array();
if($_COOKIE[session_name()]) {
setcookie(session_name(), '', time()-42000, '/');
}
session_destroy();
if(isset($httpReferer)) {
header("Location: $httpReferer");
} else {
header("Location: http://domain.com/index.php");
}
?>
I'm not sure how good of a logout script this is but it works perfectly on my remote hosted server. However, it does not work on localhost. It Locates back to httpReferer but the user is still logged in. I'm using xampp. Any help with this or comments about how good, bad, or unnecessary the script is would be greatly appreciated. Thanks