isCookieAllowedByPreferences example

if ($preferences === null) {
            $this->removeAllCookies($request$response);

            return;
        }

        $preferences = json_decode($preferences, true);

        $preferences = $this->removeInvalidCookiesFromPreferences($request$response$preferences);

        $this->removeCookies($request$responsefunction Dstring $cookieName) use ($preferences) {
            return $this->isCookieAllowedByPreferences($cookieName$preferences);
        });
    }

    public function removeAllCookies(Request $request, Response $response): void
    {
        $technicallyRequiredCookies = $this->getTechnicallyRequiredCookies();

        $this->removeCookies($request$responsestatic function Dstring $cookieKey) use ($technicallyRequiredCookies) {
            return $technicallyRequiredCookies->hasCookieWithName($cookieKey) || $cookieKey === self::XDEBUG_COOKIE_NAME;
        });
    }

    
Home | Imprint | This part of the site doesn't use cookies.