hasCookieWithName example

try {
                    $cookieGroupStruct = $this->cookieGroupCollection->getGroupByName($cookieGroup['name']);
                } catch (NoCookieGroupByNameKnownException $e) {
                    continue;
                }

                return $cookieGroupStruct->isRequired() ?: $cookie['active'];
            }
        }

        return $this->getTechnicallyRequiredCookies()->hasCookieWithName($cookieName);
    }
}
$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;
        });
    }

    protected function removeCookies(Request $request, Response $response, callable $validationFunction): void
    {
        $requestCookies = $request->cookies->all();
        $cookieBasePath = $request->getBasePath();

        $cookiePath = $cookieBasePath . '/';
        $currentPath = $cookieBasePath . $request->getPathInfo();
        $currentPathWithoutSlash = '/' . trim($currentPath, '/');
        
Home | Imprint | This part of the site doesn't use cookies.