Log in
Interface

StoreCookieManagerInterface

Magento\Store\Api\StoreCookieManagerInterface

What it does

This interface defines methods for managing store-specific cookies in Magento 2.

Developers use this to retrieve, set, or delete cookies that store the current store code, which is essential for maintaining store context across customer sessions in multi-store setups.

It's particularly useful when building features that need to persist or switch between different store views.

Public Methods

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