I'm trying to create a logout.php script that will destroy the session and prompt the user to log back in without having to close the browser window. The only way I can currently get this to work is if the user actually closes the browser and opens a new window:
Any ideas?
<?php
session_start();
// Unset all of the session variables.
$_SESSION = array();
if (isset($_COOKIE[session_name()])) {
setcookie(session_name(), '', time()-42000, '/');
}
session_destroy();
exit;
?>