Log in
Model

ManageStoreCookie

Magento\Store\Model\StoreSwitcher\ManageStoreCookie

What it does

This class manages the store cookie when customers switch between different store views in Magento 2.

It sets or deletes the store cookie based on whether the target store is the default store view, ensuring the customer's store preference is properly tracked across sessions.

Developers use this as part of the store switching mechanism to maintain store context when customers navigate between different language or regional versions of the site.

Public Methods

  • switch()