cookieName = $cookieName; $this->cookieValue = $cookieValue; } public function isRequestAllowed(ServerRequestInterface $request): bool { $cookies = $request->getCookieParams(); if ($this->cookieName === null || !isset($cookies[$this->cookieName])) { return false; } if ($this->cookieValue !== null && $cookies[$this->cookieName] !== $this->cookieValue) { return false; } return true; } }