Skip to content

Commit

Permalink
Merge pull request bcit-ci#1770 from dchill42/session
Browse files Browse the repository at this point in the history
Session Fixes for bcit-ci#1711 and bcit-ci#1756
  • Loading branch information
alexbilbie committed Sep 5, 2012
2 parents d4fa532 + 911cd95 commit 09adaa3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions system/libraries/Session/drivers/Session_cookie.php
Expand Up @@ -309,6 +309,7 @@ public function sess_destroy()
if ($this->sess_use_database === TRUE && isset($this->userdata['session_id']))
{
$this->CI->db->delete($this->sess_table_name, array('session_id' => $this->userdata['session_id']));
$this->data_dirty = FALSE;
}

// Kill the cookie
Expand Down Expand Up @@ -443,8 +444,19 @@ protected function _sess_read()
$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)
{
Expand Down

0 comments on commit 09adaa3

Please sign in to comment.