diff options
author | Frédéric Guillot <fred@kanboard.net> | 2014-09-19 22:08:04 +0200 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2014-09-19 22:08:04 +0200 |
commit | 95e54d1d300809cb8656c52d029f797ba5961a04 (patch) | |
tree | 44d31d492e26efb3308b70ac173baecf45b811a7 /app/Core | |
parent | 9ffa63747ae5a5ecfe8ac3e6a3276ade80e6980b (diff) |
Exclude current user in email notifications, pull-request #273)
Diffstat (limited to 'app/Core')
-rw-r--r-- | app/Core/Session.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/app/Core/Session.php b/app/Core/Session.php index c824ba64..6028f0b9 100644 --- a/app/Core/Session.php +++ b/app/Core/Session.php @@ -20,6 +20,18 @@ class Session const SESSION_LIFETIME = 0; // Until the browser is closed /** + * Return true if the session is open + * + * @static + * @access public + * @return boolean + */ + public static function isOpen() + { + return session_id() !== ''; + } + + /** * Open a session * * @access public @@ -50,14 +62,14 @@ class Session ini_set('session.hash_bits_per_character', 6); // If session was autostarted with session.auto_start = 1 in php.ini destroy it, otherwise we cannot login - if (isset($_SESSION)) - { + if (isset($_SESSION)) { session_destroy(); } // Custom session name session_name('__S'); + // Start the session session_start(); // Regenerate the session id to avoid session fixation issue |