summaryrefslogtreecommitdiff
path: root/app/Core/Session.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Core/Session.php')
-rw-r--r--app/Core/Session.php16
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