From 95e54d1d300809cb8656c52d029f797ba5961a04 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Fri, 19 Sep 2014 22:08:04 +0200 Subject: Exclude current user in email notifications, pull-request #273) --- app/Core/Session.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'app/Core') 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 @@ -19,6 +19,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 * @@ -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 -- cgit v1.2.3