public function write($id, $data) { try { if ($this->isExistingSession) { if ($this->originalData != $data || $this->forceUpdate) { SessionData::updateData($id, $data, $this->userID, $this->cacheUpdated, $this->db); } } else { SessionData::insertData($id, $data, $this->userID, $this->cacheUpdated, $this->db); } return true; } catch (Exception $e) { return false; } }