Magento 2 Cookie Settings

Magento 2 Cookie Settings and Troubleshooting Tips: Complete Guides

by nkhuyen

Cookies are a well-known feature among web users; enabling the Magento 2 cookie setting allows store owners to track customer activity and enhance their online shopping experience. These cookies are tiny text files stored in a web user’s browser directory or data folder that store user information like usernames, passwords, and browsing history. Therefore, you can conveniently adjust Magento 2 cookie settings to suit your store’s needs.

In this article, BSS Commerce guides you through the process of configuring Magento 2 cookies and editing cookie policies and messages. Also, this post gives some tips for resolving issues with setting up Magento 2 cookies and frequently asked questions about cookies in Magento 2. Stay tuned.

Quick Overview of Cookies in Magento 2

To obtain a deeper understanding of Magento 2 cookie settings, read more about what cookies are in Magento 2 and how cookies in the Magento 2 store work, provided below:

What are cookies in Magento 2?

Cookies in Magento 2 are small pieces of information generated by websites and stored on your device. They contain data about users’ online sessions, including their browsing history and page visits. Cookies are mainly used to enhance user experiences and provide recommendations based on their previous actions.

For store owners, cookies play a crucial role in tracking customers’ website journeys and informing their strategies. Websites must obtain user consent for cookies and provide an option to refuse them.

How do cookies in Magento 2 store work?

Magento 2 stores use cookies, similar to most websites, to enhance user experience and store data. Here’s a breakdown of how Magento 2 cookies work:

Types of Cookies:

  • Session cookies: These temporary cookies store information about a user’s current browsing session. They typically expire when the user closes the browser. Magento 2 uses session cookies to store shopping cart contents, login information, and browsing history within a session.
  • Persistent cookies: These cookies remain on the user’s device for a set period or until manually deleted. Magento 2 leverages persistent cookies to remember user preferences (like currency or language) and for functionalities like wishlist or login credentials (if chosen by the user).

Key cookie uses in Magento 2:

  • Personalization: Cookies enable Magento 2 to remember user preferences and browsing behavior. This allows for features like product recommendations based on past views or pre-filling forms with saved information.
  • Session management: Cookies facilitate session management, ensuring a smooth shopping experience. They keep track of items added to the cart and user login status.
  • Analytics: Cookies can be used to gather data on user behavior for website analytics. This information helps store owners understand customer journeys and optimize their Magento 2 store.

Therefore, Magento cookie settings are essential for improving the customer’s browsing experience. They help maintain session continuity, enabling customers to pick up where they left off while shopping. In the upcoming section, BSS Commerce will give some guidelines for enabling cookie restriction mode, edit the cookies policy in Magento 2, and give tips to update the latest Google consent mode v2 for Magento 2 by using the Magento Cookie Consent extension. Now, let’s get started:

Magento 2 Cookie Settings: How to Enable Cookie Restriction Mode

The Cookie Restriction Mode in Magento 2 guarantees adherence to GDPR and other regulations by displaying a cookie consent banner, enabling users to provide their consent. This functionality limits specific features until users agree to the cookie policy. Here’s how to enable Magento 2 cookie restriction mode:

1. Access the Magento 2 admin panel

2. Go to “Stores > Settings > Configuration”

3. Open the “Default Cookie Settings” section

magento 2 cookie settings 4

4. Enter the “Cookie Lifetime” in seconds. By Magento 2 default cookie settings, the value is set to 3600 seconds. However, if you wish for the cookies to expire immediately after the customer closes the browser, simply input 0 in this field.

magento 2 cookie settings 2

5. If you wish to enable cookies for other folders, enter “Cookie Path.” To make the cookies accessible anywhere on the website, enter a forward slash (/)

6. Enter the subdomain name in the “Cookie Domain” field to make the cookies available to a specific subdomain. To enable cookies for all the subdomains you are using, enter the corresponding domain preceded by a full stop, such as “”.

NOTE: Magento 2 provides the capability to configure Magento 2 cookies for particular domain names and subdomains. Thanks to correctly configuring the cookie domain in the Magento configuration settings, cookies can be accessed throughout the primary domain and its subdomains.

7. Select YES for the “Use HTTP Only” option to prevent scripting languages from accessing the cookies.

8. Set YES to “Cookie Restriction Mode”

magento 2 cookie settings 1

9. Finally, save the configuration by clicking the “Save Config” button.

How to Edit the Cookies Policy in Magento 2

The cookies policy in Magento 2 is crucial for providing a personalized user experience, such as remembering user preferences and shopping cart information. In addition, a clear Magento 2 cookie policy enhances trust as users are aware of their data usage and rights. In this guide, we’ll explain how to edit the cookies policy in Magento 2 with easy steps:

1. Navigate to Content > Elements > Pages in your admin panel.

2. Locate the Privacy Policy page and click on Edit from the Action dropdown.

3. If the page is not already enabled, make sure to Enable it.

4. Scroll down to the Content section and make the necessary changes to the cookie policy

magento 2 cookie settings 3

5. In the Page in Websites section, select the appropriate Store View where you want the page to be displayed.

6. Click on the Save button to save your changes.

Afterward, you can check the privacy policy page on your storefront to see how it will be displayed in your Magento store.

Updated Latest Google Consent Mode v2 by Using Magento 2 Cookie Consent

If you are using outdated versions of Magento 2 and wish to add a cookie notice to your store, you have the option to choose the Magento 2 Cookie Consent module developed by BSS Commerce. This extension displays a clean and straightforward cookie notification bar or popup on the frontend of your store, which can also be customized to match your theme!

  • Compatible with Community: 2.3.x – 2.4.x and Enterprise: 2.3.x – 2.4.x
  • One-time payment
  • 30 days money back
  • Free one-year support
  • Free installation and lifetime update

Magento 2 cookie consent by BSS Commerce

Exclusive: Get 5% OFF the module price now – Enter code: BSS5 at checkout!

Magento 2 Cookie Consent, also known as Advanced Cookie Notice, is a tool designed to assist in showing compliance with the EU User Data Privacy Policy. This module allows for easy customization of the cookie consent bar displayed on your website. It is essential for store owners to use this bar to request explicit consent for the collection and storage of visitor cookies, especially with the help of Google Consent Mode v2 for personalized ads and analytics.

Key Features

  • This extension includes almost all the features of the Magento 2 Cookie Notice extension. It allows you to:
  • Display a cookie notification popup/bar on the main store to request cookie consent from website visitors.
  • Enable customers to provide consent for the usage of cookies on the website
  • Enhance the functionality of the Cookie Notice module by adding links to both CMS pages and external pages within the notification message.
  • Customize the content, display, and positions of the cookie consent bar according to your preferences.
  • Automatically hide messages after a specified number of seconds in case of no interaction.
  • Ensure responsiveness on multiple devices for a seamless user experience.

Advanced Features

  • Magento 2 Cookie Consent extension offers advanced features to assist you in complying with the EU’s User Consent Policy
  • Provide assistance with Google Consent Mode version 2
  • Collect consented cookies for Google Analytics tools, Google Tag Manager, and business marketing such as Google Ads
  • Establish default settings for cookie collection in cases where users do not engage with the consent banner.

Coming soon features

  • Enable users to personalize cookie groups for collection
  • Incorporate GeoIP integration to implement consent bar for specific regions/countries

These functionalities are scheduled to be implemented in the near future. In addition, if you aim to not only comply with cookie regulations but also ensure your Magento 2 store is GDPR compliant, consider checking out the Magento 2 GDPR extension free here!

Bottom Line – Magento 2 Cookie Settings

Enabling Magento 2 Cookie Settings is an ideal way to display a cookie banner on your website, inform visitors about the usage of cookies, and adhere to legal regulations. However, it may not encompass all the necessary requirements to ensure full compliance with data privacy regulations and cookie laws in all jurisdictions.

For instance, it lacks the ability to offer granular consent options, limiting users to a simple “accept” or “reject” for all cookies without the option to choose specific types of cookies. Moreover, it may not fully address the handling of third-party cookies and may not provide explicit mechanisms for users to withdraw their consent or regularly update their cookie preferences.

Therefore, the best solution is to opt for the Magento 2 Cookie Consent extension developed by BSS Commerce, which can prove highly advantageous as it allows for greater control over your cookie banner and enables you to meet specific compliance requirements. This extension offers advanced features and customization options, ensuring a seamless and user-friendly experience.

Hope that these guidelines are good for you!

FAQs – Magento 2 Cookie Settings

Can Magento 2 extensions have an impact on browser cookie settings?

Yes. Magento 2 modules have the potential to affect cookie settings in web browsers. Certain extensions may introduce new cookies or make changes to existing ones in order to improve functionality or gather analytics data. It is recommended to carefully review the details of each extension and assess their impact on cookies to ensure compliance and maintain a seamless user browsing experience.

Is there a method to disable cookie notifications in Magento 2?

Yes. Users have the option to opt out or disable cookie notifications in Magento 2 by declining to give consent to the cookie policy shown in the banner. This decision could limit access to specific features until users decide to accept cookies.

What is the process for customizing the cookie banner in Magento 2?

To customize the cookie banner in Magento 2, go to the backend, access the content manager, and make changes to the cookie notice. You have the flexibility to modify the text, link it to your privacy policy, and determine its placement on the frontend.

Next Reading Suggestions

© 2019 BSS Commerce owned by THANH CONG INTER ., JSC. All Rights Reserved.
Business registration certificate no. 0106064469 issued by Hanoi Department of Planning and Investment on 19 December 2019.
Legal Representative: Mr. Nguyen Quang Trung.