Commit 83a793ba authored by tbrehm's avatar tbrehm
Browse files

Improved the session handler so that it does not write unchanged sessions to database.

parent efb7dc28
...@@ -56,7 +56,7 @@ class session { ...@@ -56,7 +56,7 @@ class session {
if (is_array($rec)) { if (is_array($rec)) {
$this->session_array = $rec; $this->session_array = $rec;
return $rec['session_data']; return $this->session_array['session_data'];
} else { } else {
return ''; return '';
} }
...@@ -68,6 +68,11 @@ class session { ...@@ -68,6 +68,11 @@ class session {
$this->session_array = array(); $this->session_array = array();
} }
// Dont write session to DB if session data has not been changed after reading it.
if(isset($this->session_array['session_data']) && $this->session_array['session_data'] != '' && $this->session_array['session_data'] == $session_data) {
return true;
}
if ($this->session_array['session_id'] == '') { if ($this->session_array['session_id'] == '') {
$session_id = $this->db->quote($session_id); $session_id = $this->db->quote($session_id);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment