exec('exit'); // Unset all of the session variables. $_SESSION = array(); // delete the session cookie if (isset($_COOKIE[session_name()])) { setcookie(session_name(), '', time()-42000, '/'); } // destroy "keeped me logged in" cookie //setcookie('helga', false, time() - 86400, '/'); // destroy the session session_destroy(); // redirect back to the shots page, which will in turn // will print the login screen since a session no longer // exists. header('Location: viewFolder.php'); ?>