summaryrefslogtreecommitdiffstats
path: root/system/libraries/Session
diff options
context:
space:
mode:
authordchill42 <dchill42@gmail.com>2012-09-04 16:15:14 +0200
committerdchill42 <dchill42@gmail.com>2012-09-04 16:15:14 +0200
commitcd436e92ec5f9a5d0361fb186bccacb908dbea22 (patch)
tree1a31c702497ad16676c61348b8899d2d3be9da69 /system/libraries/Session
parent97b0d8331eecd7f3efe3a1c9a93de55a2f26e877 (diff)
That doesn't go there. Put cache fix around correct query.
Signed-off-by: dchill42 <dchill42@gmail.com>
Diffstat (limited to 'system/libraries/Session')
-rwxr-xr-xsystem/libraries/Session/drivers/Session_cookie.php22
1 files changed, 11 insertions, 11 deletions
diff --git a/system/libraries/Session/drivers/Session_cookie.php b/system/libraries/Session/drivers/Session_cookie.php
index ce63b976f..52eeddbc4 100755
--- a/system/libraries/Session/drivers/Session_cookie.php
+++ b/system/libraries/Session/drivers/Session_cookie.php
@@ -444,8 +444,19 @@ class CI_Session_cookie extends CI_Session_driver {
$this->CI->db->where('user_agent', $session['user_agent']);
}
+ // Is caching in effect? Turn it off
+ $db_cache = $this->CI->db->cache_on;
+ $this->CI->db->cache_off();
+
$query = $this->CI->db->limit(1)->get($this->sess_table_name);
+ // Was caching in effect?
+ if ($db_cache)
+ {
+ // Turn it back on
+ $this->CI->db->cache_on();
+ }
+
// No result? Kill it!
if ($query->num_rows() === 0)
{
@@ -572,22 +583,11 @@ class CI_Session_cookie extends CI_Session_driver {
$set['user_data'] = $this->_serialize($userdata);
}
- // Is caching in effect? Turn it off
- $db_cache = $this->CI->db->cache_on;
- $this->CI->db->cache_off();
-
// Run the update query
// Any time we change the session id, it gets updated immediately,
// so our where clause below is always safe
$this->CI->db->update($this->sess_table_name, $set, array('session_id' => $this->userdata['session_id']));
- // Was caching in effect?
- if ($db_cache)
- {
- // Turn it back on
- $this->CI->db->cache_on();
- }
-
// Clear dirty flag to prevent double updates
$this->data_dirty = FALSE;