diff options
author | dchill42 <dchill42@gmail.com> | 2012-07-31 15:32:23 +0200 |
---|---|---|
committer | dchill42 <dchill42@gmail.com> | 2012-07-31 15:32:23 +0200 |
commit | b185537938061bf9b8f132f9f3c3992e12902be8 (patch) | |
tree | 29a36d38a6459c3ec6bb41dfa053aca2aa52b315 /system/libraries/Session/Session.php | |
parent | c58722535e0358367f351c168480ef98a033264c (diff) |
Fixed userdata synchronization, loaded driver check, and all_flashdata keys
Diffstat (limited to 'system/libraries/Session/Session.php')
-rwxr-xr-x | system/libraries/Session/Session.php | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/system/libraries/Session/Session.php b/system/libraries/Session/Session.php index 734334249..68819a665 100755 --- a/system/libraries/Session/Session.php +++ b/system/libraries/Session/Session.php @@ -95,7 +95,6 @@ class CI_Session extends CI_Driver_Library { // Load driver and get array reference $this->load_driver($driver); - $this->userdata =& $this->current->get_userdata(); // Delete 'old' flashdata (from last request) $this->_flashdata_sweep(); @@ -119,6 +118,7 @@ class CI_Session extends CI_Driver_Library { { // Save reference to most recently loaded driver as library default $this->current = parent::load_driver($driver); + $this->userdata =& $this->current->get_userdata(); return $this->current; } @@ -134,14 +134,12 @@ class CI_Session extends CI_Driver_Library { $lowername = strtolower(str_replace('CI_', '', $driver)); if (in_array($lowername, array_map('strtolower', $this->valid_drivers))) { - // See if regular or lowercase variant is loaded - if (class_exists($driver)) - { - $this->current = $this->$driver; - } - else if (class_exists($lowername)) + // See if driver is loaded + $child = str_replace($this->lib_name.'_', '', $driver); + if (isset($this->$child)) { - $this->current = $this->$lowername; + $this->current = $this->$child; + $this->userdata =& $this->current->get_userdata(); } else { @@ -211,6 +209,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); $out[$key] = $val; } } |