protected function initializeSession() { $this->data = []; $this->dataHash = null; $this->handler->open(null, $this->name); if (empty($this->id)) { $this->id = $this->generator->generateId(); } $this->collectGarbage(); // Must be done before read $data = $this->handler->read($this->id); if (!$data) { // Intentionally catch falsely values return; } if ($this->options->getBoolean('lazy_write', false)) { $this->dataHash = md5($data); } try { $this->data = $this->serializer->unserialize($data); } catch (\Exception $e) { // Destroy data upon unserialization error $this->handler->destroy($this->id); } }
protected function initializeSession() { $this->handler->open(null, $this->id); $data = $this->handler->read($this->id); try { $this->data = $this->serializer->unserialize($data); } catch (\Exception $e) { // Destroy data upon unserialization error $this->handler->destroy($this->id); } }