Created
July 9, 2013 16:44
-
-
Save trevorgreenleaf/5959008 to your computer and use it in GitHub Desktop.
Session
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach($_SESSION as $key => $value) | |
{ | |
unset($_SESSION[$key]); | |
} | |
// 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"] | |
); | |
} | |
session_destroy(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment