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:----viSV1VMbp7b1wCngtqxVq4K00ZXpsC1NmGt7pwbeUnt8SRrikAyAVvp678kp8vlhrx1d4v1gd3AVbr0+PluobY/BuC44Hxi3mHIRwrURd1RAsMcYPw4PkRjtq+Htba83/SdoBCSwZpaPCwX3RauNorAOlXwy/WsKCq9GA08xR7t/xsAU6LyK4oDJlAB99x46eVVtguvHDXazhjtEPHq/xjI4TvEg7vQIyLJB2HsL5dqCvlABrJnyse2yptXDFBSgSGej/hPReuig6lmsMKm65gGQQBt+m9RVITK3DuG518hX8mGFofqgiCmNp592yShgTqYoKrYW4GxEJ/D0J+iyOD7Nl3T+XjXdr9gzZozYxje7S/yaSgyVc1wHYIjAcmxbaMDc92BWbcrKjpXRVGQofUcAyMah6MjQqTKQ0lsfq9OS0LrRnVkuW+jGFl/cNvMhh0Xn4NRdsxWS0TFSWDweo1pq00JQ8RA8dTzd6E4GH19GKcMaiDsJpyWS6D05yfvxKdBSGlXjNn92/YGH4NxkIeoGNGqXCqGwVrjclqEljOmehskCGnxPYlqKnwXxKHiCnceoDlWxCcEc7CHoyoEGD7ovRXb65n39ASLz4xmoiaehYsVvnnHvtyYiPvgIo5ydI/D22g0O44+I1u/gcyNPozS/O6RgNQA93UZU+kUqdps=----ATTACHMENT:----NjgzNTcxMzUxNTgxMzY1MSAzMjE0MTgxNDU4ODg0MTQgOTk5OTk2MDAzNzkyODEyNQ==