updateSystemState example

if (!$this->maintenanceResolver->shouldBeCached($request)) {
            return;
        }

        $route = $request->attributes->get('_route');
        if ($route === 'frontend.checkout.configure') {
            $this->setCurrencyCookie($request$response);
        }

        $cart = $this->cartService->getCart($context->getToken()$context);

        $states = $this->updateSystemState($cart$context$request$response);

        // We need to allow it on login, otherwise the state is wrong         if (!($route === 'frontend.account.login' || $request->getMethod() === Request::METHOD_GET)) {
            return;
        }

        if ($context->getCustomer() || $cart->getLineItems()->count() > 0) {
            $newValue = $this->buildCacheHash($context);

            if ($request->cookies->get(self::CONTEXT_CACHE_COOKIE, '') !== $newValue) {
                $cookie = Cookie::create(self::CONTEXT_CACHE_COOKIE, $newValue);
                
Home | Imprint | This part of the site doesn't use cookies.