public function writeSession($id, $data)
{
// exception must be caught in session write handler
// http://us.php.net/manual/en/function.session-set-save-handler.php
try {
$this->db->getCollection($this->sessionCollection)->update(['id' => $id], $this->composeFields($id, $data), ['upsert' => true]);
} catch (\Exception $e) {
$exception = ErrorHandler::convertExceptionToString($e);
// its too late to use Yii logging here
error_log($exception);
echo $exception;
return false;
}
return true;
}