public function resume(IServerRequest $request) { if ($this->isActive()) { return true; } $cookies = $request->getCookieParams(); if (!array_key_exists(session_name(), $cookies)) { return false; } if (!session_start()) { throw new \RuntimeException('Can not resume session'); } $inner_storage = $this->getInnerStorage(); if (!$inner_storage->has('started_at')) { $this->stop(); return false; } return true; }