From 76bc123062fef1a79a361f9bcb288bc477fcd76f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Guillot?= Date: Wed, 28 May 2014 18:39:05 -0400 Subject: [PATCH] Improve session destroy --- vendor/PicoFarad/Session.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/vendor/PicoFarad/Session.php b/vendor/PicoFarad/Session.php index 107ac7c..5ca2d41 100644 --- a/vendor/PicoFarad/Session.php +++ b/vendor/PicoFarad/Session.php @@ -41,6 +41,25 @@ function open($base_path = '/', $save_path = '') 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(); }