clearExistingCookie example

Shopware()->Container()->get(CartPersistServiceInterface::class)->persist();
        }

        $shop = Shopware()->Shop();

        $this->sSYSTEM->sUSERGROUP = $shop->getCustomerGroup()->getKey();
        $this->sSYSTEM->sUSERGROUPDATA = $shop->getCustomerGroup()->toArray();
        $this->sSYSTEM->sCurrency = $shop->getCurrency()->toArray();

        $this->contextService->initializeContext();

        $this->csrfTokenValidator->clearExistingCookie();

        if (!$this->config->get('clearBasketAfterLogout')) {
            $this->moduleManager->Basket()->sRefreshBasket();

            $countries = $this->sGetCountryList();
            $country = reset($countries);
            if (!\is_array($country)) {
                $country = null;
            }

            $this->sGetPremiumShippingcosts($country);

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