summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-05-28 18:36:09 -0400
committerFrédéric Guillot <fred@kanboard.net>2014-05-28 18:36:09 -0400
commitb6b124aadde36b545b166049fde2cfbbc8b0a553 (patch)
tree56a04f9f8a113de0683b3566c1460a32db6a6565
parent99b5758dd63b8b4fc9fa7fbe3e2540c6d7d8d031 (diff)
Improve session destroy
-rw-r--r--app/Core/Session.php19
1 files changed, 19 insertions, 0 deletions
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();
}