regenerateSessionId example

public function logout()
    {
        if ($this->config->get('migrateCartAfterLogin')) {
            Shopware()->Container()->get(CartPersistServiceInterface::class)->prepare();
        }

        if ($this->config->get('clearBasketAfterLogout')) {
            $this->moduleManager->Basket()->sDeleteBasket();
        }

        $this->session->clear();
        $this->regenerateSessionId(true);

        if ($this->config->get('migrateCartAfterLogin')) {
            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();

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