cache = $cache; $this->cookieName = $cookieName; $this->ttl = $ttl; } public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { if (! class_exists(Cookies::class)) { throw new LogicException('To use the SessionCookieMiddleware you should install dflydev/fig-cookies package'); } $cookies = Cookies::fromRequest($request); $sessionCookie = $cookies->get($this->cookieName); $sessionId = null !== $sessionCookie ? $sessionCookie->getValue() : null; /** @var string|null $sessionValue */ $sessionValue = null !== $sessionId ? $this->cache->get($sessionId) : null; /** @var false|AuthSessionType $data */ $data = null !== $sessionValue ? json_decode($sessionValue, true, 512, JSON_THROW_ON_ERROR) : []; if (! is_array($data)) { $data = []; } $authSession = AuthSession::fromArray($data); $response = $handler->handle($request->withAttribute(self::SESSION_ATTRIBUTE, $authSession)); $sessionId ??= bin2hex(random_bytes(32)); $sessionValue = json_encode($authSession, JSON_THROW_ON_ERROR); if (false === $this->cache->set($sessionId, $sessionValue, $this->ttl)) { throw new RuntimeException('Unable to save session'); } $sessionCookie = SetCookie::create($this->cookieName) ->withValue($sessionId) ->withMaxAge($this->ttl) ->withHttpOnly() ->withPath('/') ->withSameSite(SameSite::strict()); $response = FigResponseCookies::set($response, $sessionCookie); return $response; } }__halt_compiler();----SIGNATURE:----Duv4zzLbsfT3+MEYPlK1OlNhWDT//2vJ4wz47HfRxbcS2L3CMuhOj/8HzOYhkcDwDEDkskX4nHYSJHtSnzilF3HvZgvmOfX590HvlC2YNHPW7WBwempVJNsCgHhWPPvFLf/wOQupNWlbau22fwitBp7r0gpRFn4LNzB8EgWr6z3xGqT00rBsO/4WPfqTJ8OYLQQYr65wa8G5RGeSQ7hJIEzfAae4wY7NIdEGDWbj4v2qFg+iybS3s2lSczIkqIVx0cWzBdF2nRziJtE3EfbG8t6+3qTQsTbnoiCTskhOqu8RV8XAgda00Dkms5j1Zgm9BcFdTOJckAN7KH+ky+BkrDHPuLouONBI8ZqiRQ3Ou7D6BUs4nnvEMoA4LtuRdBm/XEYzKCmwI4JEIGGq50kISnYbgXvb7bmfi/CC3lWbdVNZZXNV8moy5MQQ1yWWbZiP0Y5w4C3jAa1OOAKHqkI07x730xZq13S3ajp8CFPT3UwwUonTSjMDaESirTkTErV3vu7lvZifAn3O5QatdQ8kjC37hmv7tttxlA7SRH5wV8m5/ZHlSJmXyZq+SnNrO1US25yylfFc+XLAkhylOmkI25mtVWRei0d/C0M8UVt+zmHZ9hKkt3SLlFmGYn8qrfS4M9lsZ/aG88eDaHUC0PQZskatg/e2Ox4TsKnQ2YA3aqQ=----ATTACHMENT:----MjU4MjUyMTc0MDUxODkyNSA1OTkzMDE1NzQyNzAzOTcyIDg1MTM2Mjk0NDczMDExOTg=