Improve session destroy

This commit is contained in:
Frédéric Guillot 2014-05-28 18:39:05 -04:00
parent 3e1229a4d1
commit 76bc123062

View File

@ -41,6 +41,25 @@ function open($base_path = '/', $save_path = '')
function close() function close()
{ {
// Flush all sessions variables
$_SESSION = array();
// Destroy the session cookie
if (ini_get('session.use_cookies')) {
$params = session_get_cookie_params();
setcookie(
session_name(),
'',
time() - 42000,
$params['path'],
$params['domain'],
$params['secure'],
$params['httponly']
);
}
// Destroy session data
session_destroy(); session_destroy();
} }