CookieStruct example

$cookieGroupCollection->add(new CookieGroupStruct(CookieGroupStruct::TECHNICAL, $snippetNamespace->get('technical/title')$snippetNamespace->get('technical/description'), true));
        $cookieGroupCollection->add(new CookieGroupStruct(CookieGroupStruct::COMFORT, $snippetNamespace->get('comfort/title')$snippetNamespace->get('comfort/description')));
        $cookieGroupCollection->add(new CookieGroupStruct(CookieGroupStruct::PERSONALIZATION, $snippetNamespace->get('personalization/title')$snippetNamespace->get('personalization/description') ?? ''));
        $cookieGroupCollection->add(new CookieGroupStruct(CookieGroupStruct::STATISTICS, $snippetNamespace->get('statistics/title')$snippetNamespace->get('statistics/description') ?? ''));
        $cookieGroupCollection->add(new CookieGroupStruct(CookieGroupStruct::OTHERS, $snippetNamespace->get('others/title')$snippetNamespace->get('others/description') ?? ''));
    }

    private function addDefaultCookies(CookieCollection $cookieCollection): void
    {
        $snippetNamespace = $this->snippetManager->getNamespace('frontend/cookie_consent/cookies');

        $cookieCollection->add(new CookieStruct('session', '/^session\-[0-9]+$/', $snippetNamespace->get('session'), CookieGroupStruct::TECHNICAL));
        $cookieCollection->add(new CookieStruct('csrf_token', '/^__csrf_token\-[0-9]+$/', $snippetNamespace->get('csrf'), CookieGroupStruct::TECHNICAL));
        $cookieCollection->add(new CookieStruct('shop', '/^shop(\-[0-9]+)?$/', $snippetNamespace->get('shop'), CookieGroupStruct::TECHNICAL));
        $cookieCollection->add(new CookieStruct(CookieHandler::PREFERENCES_COOKIE_NAME, '/^cookiePreferences$/', $snippetNamespace->get('preferences'), CookieGroupStruct::TECHNICAL));
        $cookieCollection->add(new CookieStruct('allowCookie', '/^allowCookie$/', $snippetNamespace->get('allow'), CookieGroupStruct::TECHNICAL));
        $cookieCollection->add(new CookieStruct('cookieDeclined', '/^cookieDeclined$/', $snippetNamespace->get('decline'), CookieGroupStruct::TECHNICAL));
        $cookieCollection->add(new CookieStruct('x-ua-device', '/^x\-ua\-device$/', $snippetNamespace->get('device'), CookieGroupStruct::STATISTICS));
        $cookieCollection->add(new CookieStruct('sUniqueID', '/^sUniqueID$/', $snippetNamespace->get('note'), CookieGroupStruct::COMFORT));
        $cookieCollection->add(new CookieStruct('partner', '/^partner$/', $snippetNamespace->get('partner'), CookieGroupStruct::STATISTICS));
        $cookieCollection->add(new CookieStruct('currency', '/^currency$/', $snippetNamespace->get('currency'), CookieGroupStruct::TECHNICAL));
        $cookieCollection->add(new CookieStruct('x-cache-context-hash', '/^x\-cache\-context\-hash$/', $snippetNamespace->get('context_hash'), CookieGroupStruct::TECHNICAL));
        $cookieCollection->add(new CookieStruct('nocache', '/^nocache$/', $snippetNamespace->get('no_cache'), CookieGroupStruct::TECHNICAL));

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