diff options
author | Andrey Andreev <narf@devilix.net> | 2016-03-15 13:39:02 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2016-03-15 13:39:02 +0100 |
commit | 2c10f60586faf59b9380608c5a9bf01ff2522483 (patch) | |
tree | e5481cbc7c28b20919258033f07f2f4c39aa52f0 /system/libraries/Session | |
parent | a990a8d195a13dd38bdd1620391a4e1b40770952 (diff) |
Add __isset() to CI_Session
Diffstat (limited to 'system/libraries/Session')
-rw-r--r-- | system/libraries/Session/Session.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/system/libraries/Session/Session.php b/system/libraries/Session/Session.php index 77c56ae70..c9d2e8adc 100644 --- a/system/libraries/Session/Session.php +++ b/system/libraries/Session/Session.php @@ -584,6 +584,24 @@ class CI_Session { // ------------------------------------------------------------------------ /** + * __isset() + * + * @param string $key 'session_id' or a session data key + * @return bool + */ + public function __isset($key) + { + if ($key === 'session_id') + { + return (session_status() === PHP_SESSION_ACTIVE); + } + + return isset($_SESSION[$key]); + } + + // ------------------------------------------------------------------------ + + /** * __set() * * @param string $key Session data key |