Skip to content

Commit

Permalink
Add __isset() to CI_Session
Browse files Browse the repository at this point in the history
  • Loading branch information
narfbg committed Mar 15, 2016
1 parent a990a8d commit 2c10f60
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions system/libraries/Session/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,24 @@ public function __get($key)

// ------------------------------------------------------------------------

/**
* __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()
*
Expand Down
1 change: 1 addition & 0 deletions user_guide_src/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Bug fixes for 3.0.6
-------------------

- Fixed a bug (#4516) - :doc:`Form Validation Library <libraries/form_validation>` always accepted empty array inputs.
- Fixed a bug where :doc:`Session Library <libraries/sessions>` allowed accessing ``$_SESSION`` values as class properties but ``isset()`` didn't work on them.

Version 3.0.5
=============
Expand Down

0 comments on commit 2c10f60

Please sign in to comment.