Commit 800e212e authored by Nigel McNie's avatar Nigel McNie

Add a method for nuking a session.

This probably needs calling in a few places, especially when the currently logged in user changes while the session is hanging around.
parent 604e94d3
......@@ -219,6 +219,24 @@ class Session {
}
}
/**
* Destroy a session
*/
public function destroy_session() {
if ($this->is_live()) {
$_SESSION = array();
if (isset($_COOKIE[session_name()])) {
setcookie(session_name(), '', time() - 65536,
ini_get('session.cookie_path'),
ini_get('session.cookie_domain'),
ini_get('session.cookie_secure'),
ini_get('session.cookie_httponly')
);
}
session_destroy();
}
}
/**
* Find out if the session has been started yet
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment