summaryrefslogtreecommitdiffstats
path: root/system/libraries/Session/Session.php
diff options
context:
space:
mode:
authordchill42 <dchill42@gmail.com>2012-07-31 16:55:07 +0200
committerdchill42 <dchill42@gmail.com>2012-07-31 16:55:07 +0200
commit2642920e4781db091309ab97d0ff43c22e7c7e44 (patch)
tree539f9ef3d709b3debbaf038e1947dfdb8e43b66e /system/libraries/Session/Session.php
parent4153c928229ff174743b78472ae27138cd715efe (diff)
Damn, missed files on last commit
Diffstat (limited to 'system/libraries/Session/Session.php')
-rwxr-xr-xsystem/libraries/Session/Session.php16
1 files changed, 11 insertions, 5 deletions
diff --git a/system/libraries/Session/Session.php b/system/libraries/Session/Session.php
index 68819a665..41539a598 100755
--- a/system/libraries/Session/Session.php
+++ b/system/libraries/Session/Session.php
@@ -64,7 +64,10 @@ class CI_Session extends CI_Driver_Library {
// Get valid drivers list
$CI =& get_instance();
- $this->valid_drivers = array('Session_native', 'Session_cookie');
+ $this->valid_drivers = array(
+ 'Session_native',
+ 'Session_cookie'
+ );
$key = 'sess_valid_drivers';
$drivers = (isset($params[$key])) ? $params[$key] : $CI->config->item($key);
if ($drivers)
@@ -116,7 +119,7 @@ class CI_Session extends CI_Driver_Library {
*/
public function load_driver($driver)
{
- // Save reference to most recently loaded driver as library default
+ // Save reference to most recently loaded driver as library default and sync userdata
$this->current = parent::load_driver($driver);
$this->userdata =& $this->current->get_userdata();
return $this->current;
@@ -138,11 +141,13 @@ class CI_Session extends CI_Driver_Library {
$child = str_replace($this->lib_name.'_', '', $driver);
if (isset($this->$child))
{
+ // Make driver current and sync userdata
$this->current = $this->$child;
- $this->userdata =& $this->current->get_userdata();
+ $this->userdata =& $this->current->get_userdata();
}
else
{
+ // Load new driver
$this->load_driver($driver);
}
}
@@ -167,8 +172,9 @@ class CI_Session extends CI_Driver_Library {
*/
public function sess_regenerate($destroy = false)
{
- // Just call regenerate on driver
+ // Call regenerate on driver and resync userdata
$this->current->sess_regenerate($destroy);
+ $this->userdata =& $this->current->get_userdata();
}
/**
@@ -209,7 +215,7 @@ class CI_Session extends CI_Driver_Library {
// if it contains flashdata, add it
if (strpos($key, self::FLASHDATA_KEY.self::FLASHDATA_OLD) !== FALSE)
{
- $key = str_replace(self::FLASHDATA_KEY.self::FLASHDATA_OLD, '', $key);
+ $key = str_replace(self::FLASHDATA_KEY.self::FLASHDATA_OLD, '', $key);
$out[$key] = $val;
}
}