Skip to content

Commit

Permalink
CI: Session: Added docblock to Session Driver::bind_userdata(), fixed…
Browse files Browse the repository at this point in the history
… WS issue.

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_ci@11138 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
Tim Klingenberg committed Oct 10, 2011
1 parent 8d54d3a commit 01cf29d
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions application/libraries/Session/Session.php
Expand Up @@ -109,6 +109,15 @@ public function __construct(array $params = array())
log_message('debug', 'Session routines successfully run');
}

/**
* (Re-) bind session drivers data-store
* to session object.
*
* For example this is needed if a new session is started to
* reference the (new) $_SESSION array. Otherwise the old
* zval container of $_SESSION is still referenced which
* is useless.
*/
public function bind_userdata()
{
$this->userdata =& $this->current->get_userdata();
Expand All @@ -122,11 +131,10 @@ public function bind_userdata()
*/
public function load_driver($driver)
{
if ('userdata' === $driver)
{
// var_dump($driver, $this->current);
throw new Exception('Invalid Session Access, check CodeIgniter documentation.');
}
if ('userdata' === $driver)
{
throw new Exception('Invalid Session Access, check CodeIgniter documentation.');
}

// Save reference to most recently loaded driver as library default
$this->current = parent::load_driver($driver);
Expand Down

0 comments on commit 01cf29d

Please sign in to comment.