Interesting snippet of code. To completely destroy a session and all associated data including any cookies
session_start();
//Clear out all session data
$_SESSION = array();
//if a cookie is set set the cookie expiry date to yesterday
if (isset($_COOKIE[session_name()])) {
setcookie(session_name(), '', time()-86400, '/');
}
//destroy the session
session_destroy();
Tuesday, August 25, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment