Skip to content
Snippets Groups Projects
Commit 3828a649 authored by Jared Hancock's avatar Jared Hancock
Browse files

session: Properly track new sessions

ee91d179 introduced a slightly different
tracking system for detecting sessions. Instead of completely disabling the
session system for AJAX and cron requests, it detects if the session is new
or not based on the session_id() and existing data in the session backend.

However, the patch did not correctly determine if a session was new.
Instead, it flagged all session as existing. This patch fixes the detection
of existing session data so that AJAX and cron requests can operate without
writing session data to the backend.
parent 200a3869
Branches
Tags
No related merge requests found
......@@ -77,7 +77,7 @@ class osTicketSession {
}
function read($id){
$this->isnew = true;
$this->isnew = false;
if (!$this->data || $this->id != $id) {
$sql='SELECT session_data FROM '.SESSION_TABLE
.' WHERE session_id='.db_input($id)
......@@ -86,10 +86,12 @@ class osTicketSession {
return false;
elseif (db_num_rows($res))
list($this->data)=db_fetch_row($res);
else
// No session data on record -- new session
$this->isnew = true;
$this->id = $id;
}
$this->data_hash = md5($id.$this->data);
$this->isnew = false;
return $this->data;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment