CookieGroupStruct example

$cookieGroup = $cookieGroupCollection->getGroupByName($cookie->getGroupName());

            $cookie->setGroup($cookieGroup);
            $cookieGroup->addCookie($cookie);
        }
    }

    private function addDefaultGroups(CookieGroupCollection $cookieGroupCollection): void
    {
        $snippetNamespace = $this->snippetManager->getNamespace('frontend/cookie_consent/groups');

        $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));
        
Home | Imprint | This part of the site doesn't use cookies.