Logout Issue
Posted: Wed Oct 29, 2014 5:19 pm
Not sure why it just started happening, but when I click logout, it takes the person to logout.php and it should take them back to the index.... It was working fine, but just started doing this.
LOGOUT.PHP
I have also tried and replaced the index.php with the actual URL to the index.php, but it didn't work either.
LOGOUT.PHP
Code: Select all
<?php
session_start();
// Set Session data to an empty array
$_SESSION = array();
// Expire their cookie files
if(isset($_COOKIE["id"]) && isset($_COOKIE["user"]) && isset($_COOKIE["pass"])) {
setcookie("id", '', strtotime( '-5 days' ), '/');
setcookie("user", '', strtotime( '-5 days' ), '/');
setcookie("pass", '', strtotime( '-5 days' ), '/');
}
// Destroy the session variables
session_destroy();
// Double check to see if their sessions exists
if(isset($_SESSION['username'])){
//this should never occur
header("location: message.php?msg=Error:_Logout_Failed");
} else {
header("location: index.php");
exit();
}