Log in
Model

StoreCookieManager

Magento\Store\Model\StoreCookieManager

What it does

This class manages the 'store' cookie in Magento 2, which stores the current store code when customers switch between different store views.

Developers use this class to read, set, or delete the store cookie when implementing custom store switching functionality or when they need to persist or retrieve the customer's selected store view across sessions.

Public Methods

  • getStoreCodeFromCookie()
  • setStoreCookie()
  • deleteStoreCookie()