I realise this has been asked before but i have gone over the previous questions to no avail.
I am getting no errors, just a blank page when I logout and kill the session. The session dies but no redirect :(
Here is the include for logout
<?php
// Initialize the session.
session_start();
// Unset all of the session variables.
$_SESSION = array();
// If it's desired to kill the session, also delete the session cookie.
// Note: This will destroy the session, and not just the session data!
if (ini_get("session.use_cookies")) {
$params = session_get_cookie_params();
setcookie(session_name(), '', time() - 42000,
$params["path"], $params["domain"],
$params["secure"], $params["httponly"]
);
}
// Finally, destroy the session.
session_destroy();
if(PHP_SESSION_NONE === true){
//i added this conditional statement as a last ditch, there was no if statement to begin with just a simple redirect, neither work.
header("Locaction: index.php");
}
?>
Here is my form code.
<form action="endSession.php" method="post" id="end_session">
<button type="submit" name="end_session" id="end_button">Logout</button>
</form>