From b6b124aadde36b545b166049fde2cfbbc8b0a553 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Wed, 28 May 2014 18:36:09 -0400 Subject: Improve session destroy --- app/Core/Session.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/app/Core/Session.php b/app/Core/Session.php index 5c55311a..af7a9123 100644 --- a/app/Core/Session.php +++ b/app/Core/Session.php @@ -66,6 +66,25 @@ class Session */ public 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(); } -- cgit v1.2.3