Log in
Model

StoreCookieManager

Magento\Store\Model\StoreCookieManager

What it does

This class manages the store code cookie in Magento 2, which tracks which store view a customer is currently browsing.

Developers use this class to read the current store code from the cookie, set a new store cookie when customers switch store views, or delete the store cookie when needed.

It's essential for maintaining store context across page requests in multi-store Magento installations.

Public Methods

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