{"id":1269,"date":"2023-07-18T12:24:00","date_gmt":"2023-07-18T09:24:00","guid":{"rendered":"https:\/\/plumrocket.com\/learn\/?p=1269"},"modified":"2024-10-10T11:10:16","modified_gmt":"2024-10-10T08:10:16","slug":"how-to-configure-magento-2-cookie-restriction-mode-useful-tips","status":"publish","type":"post","link":"https:\/\/plumrocket.com\/learn\/magento-cookie-restriction-mode","title":{"rendered":"How to Configure Magento 2 Cookie Restriction Mode: Useful Tips"},"content":{"rendered":"\n<p>As an eCommerce platform, Magento 2 offers powerful and flexible solutions for online businesses. One essential feature that was implemented with the need for the privacy of user personal information is a <a href=\"https:\/\/experienceleague.adobe.com\/docs\/commerce-admin\/start\/compliance\/privacy\/compliance-cookie-law.html?lang=en\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Cookie Restriction Mode<\/a>. It allows websites to set up and control the use of cookies in compliance with privacy regulations.<\/p>\n\n\n\n<p>Since cookies are small files that are stored in a user\u2019s device to track them on the internet, they have caused many privacy concerns. Cookies serve various purposes, such as remembering user preferences, tracking analytics, etc., and it is crucial to give users control over their cookie preferences.&nbsp;<\/p>\n\n\n\n<p>In this article, you will learn how to properly configure Magento 2 Cookie Restriction Mode to make your website compliant with the regulations.<\/p>\n\n\n\n<h2>How to Configure Magento 2 Cookie Restriction Mode<\/h2>\n\n\n\n<h3>Step 1. Log in to Your Magento 2 Admin Panel<\/h3>\n\n\n\n<p>To start with, go to the Magento 2 admin panel and log in with your administrator credentials.<\/p>\n\n\n\n<h3>Step 2. Enable &amp; Set Up Magento 2 Cookie Restriction Mode<\/h3>\n\n\n\n<p>Once logged in, navigate to \u201c<strong>Stores<\/strong>\u201d on the left-hand side of the admin panel and click \u201c<strong>Configuration<\/strong>\u201d<strong>. <\/strong>Under the \u201c<strong>General<\/strong>\u201d section, select \u201c<strong>Web<\/strong>\u201d from the dropdown menu. Expand the \u201c<strong>Default Cookie Settings<\/strong>\u201d tab and set up the following:<\/p>\n\n\n\n<ul><li>Cookie Lifetime<\/li><\/ul>\n\n\n\n<p>Cookie lifetime refers to the duration for which cookies remain stored on a user&#8217;s device. The default value is \u201c3600\u201d seconds which is equal to about 1 hour. This means that users will be identified for one hour if they revisit your website. Set to \u201c0\u201d if you want cookies to expire as soon as a user closes their browser. Read more about how to choose the <a href=\"\/blog\/magento-cookie-lifetime\" target=\"_blank\" rel=\"noreferrer noopener\">optimal Cookie Lifetime value<\/a>.<\/p>\n\n\n\n<ul><li>Cookie Path<\/li><\/ul>\n\n\n\n<p>To make cookies available for some particular folders on your Magento 2 store, enter the Cookie Path here, for example, \u201c\/products\/women\/\u201d. If you want them to be available anywhere on your site, then enter a forward slash \u201c\/\u201d.<\/p>\n\n\n\n<ul><li>Cookie Domain<\/li><\/ul>\n\n\n\n<p>Specify your website domain (yourdomain.com) to make the cookies available for all your website. For a specific subdomain only, you need to enter the subdomain name (subdomain.yourdomain.com). If you want to make cookies available to all subdomains, enter the domain name preceded by a period (.yourdomain.com).<\/p>\n\n\n\n<ul><li>Use HTTP Only<\/li><\/ul>\n\n\n\n<p>To ensure users\u2019 security, select \u201cYes\u201d from the drop-down. This will prevent JavaScript or other scripting languages from gaining access to cookies.<\/p>\n\n\n\n<ul><li>Cookie Restriction Mode<\/li><\/ul>\n\n\n\n<p>Set this option to &#8220;Yes&#8221; to enable the feature and display the cookie notice on the frontend.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"1206\" height=\"669\" src=\"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2023\/07\/Magento-2-Cookie-Restriction-Mode.png\" alt=\"Guide to Magento 2 Cookie Restriction Mode\" class=\"wp-image-1270\" srcset=\"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2023\/07\/Magento-2-Cookie-Restriction-Mode.png 1206w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2023\/07\/Magento-2-Cookie-Restriction-Mode-300x166.png 300w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2023\/07\/Magento-2-Cookie-Restriction-Mode-1024x568.png 1024w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2023\/07\/Magento-2-Cookie-Restriction-Mode-768x426.png 768w\" sizes=\"(max-width: 1206px) 100vw, 1206px\" \/><\/figure>\n\n\n\n<h3>Step 3. Clearing Magento Cache and Verifying Configuration<\/h3>\n\n\n\n<p>After configuring cookie settings and the Magento 2 Cookie Restriction Mode, it is essential to clear the Magento cache to ensure the updated settings take effect. To clear the cache, go to \u201c<strong>System<\/strong>\u201d &gt; \u201c<strong>Cache Management<\/strong>\u201d in the man Magento menu, and click \u201c<strong>Flush Magento Cache<\/strong>\u201d.<\/p>\n\n\n\n<p>It&#8217;s also advisable to clear your browser cache and cookies to see the changes from a user&#8217;s perspective.<\/p>\n\n\n\n<p>Here\u2019s what the Cookie Notice looks on the frontend:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"1206\" height=\"588\" src=\"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2023\/07\/Magento-2-Cookie-Restriction-Mode-Frontend.png\" alt=\"Guide to Magento 2 Cookie Restriction Mode\" class=\"wp-image-1271\" srcset=\"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2023\/07\/Magento-2-Cookie-Restriction-Mode-Frontend.png 1206w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2023\/07\/Magento-2-Cookie-Restriction-Mode-Frontend-300x146.png 300w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2023\/07\/Magento-2-Cookie-Restriction-Mode-Frontend-1024x499.png 1024w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2023\/07\/Magento-2-Cookie-Restriction-Mode-Frontend-768x374.png 768w\" sizes=\"(max-width: 1206px) 100vw, 1206px\" \/><\/figure>\n\n\n\n<h3>Step 4. Updating Privacy Policy<\/h3>\n\n\n\n<p>Don\u2019t forget to update your privacy policy to include information about what user data your company collects and for what purposes, as required by the Cookie Law. Specifically, you need to provide the list of cookies and a detailed description of each.<\/p>\n\n\n\n<p>To edit your Magento 2 Privacy Policy, go to \u201c<strong>Stores<\/strong>\u201d in the main Magento menu and click \u201c<strong>Configuration<\/strong>\u201d. Then, select your Privacy Policy page, and in the \u201c<strong>Action<\/strong>\u201d column, click \u201c<strong>Edit<\/strong>\u201d.<\/p>\n\n\n\n<h2>Conclusion<\/h2>\n\n\n\n<p>In today&#8217;s privacy-focused digital landscape, giving users control over their cookie preferences is vital for any online business. With Magento 2&#8217;s built-in Cookie Restriction Mode, configuring and managing cookies becomes a straightforward process. By following the steps outlined in this article, you can enable and properly configure Magento 2 Cookie Restriction Mode. Prioritizing user privacy not only ensures compliance with regulations but also fosters trust and enhances the overall user experience on your Magento 2 website.<\/p>\n\n\n\n<p>Additionally, consider using <a href=\"\/magento-cookie-consent\" target=\"_blank\" rel=\"noreferrer noopener\">Magento 2 Cookie Consent extension<\/a>, which provides better options and flexibility for configuring a cookie notice. Unlike built-in Magento functionality, you get compliance with major data privacy laws, such as GDPR in European Union, CCPA in California, LGPD in Brazil, etc., as well as more ways for customization.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As an eCommerce platform, Magento 2 offers powerful and flexible solutions for online businesses. One essential feature that was implemented with the need for the privacy of user personal information is a Cookie Restriction Mode. It allows websites to set up and control the use of cookies in compliance with privacy regulations. Since cookies are &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/plumrocket.com\/learn\/magento-cookie-restriction-mode\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to Configure Magento 2 Cookie Restriction Mode: Useful Tips&#8221;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[121],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Magento 2 Cookie Restriction Mode: Setup Guide &amp; Tips<\/title>\n<meta name=\"description\" content=\"Learn what is Magento 2 Cookie Restriction Mode and how to properly configure it according to your specific business needs.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/plumrocket.com\/learn\/magento-cookie-restriction-mode\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Magento 2 Cookie Restriction Mode: Setup Guide &amp; Tips\" \/>\n<meta property=\"og:description\" content=\"Learn what is Magento 2 Cookie Restriction Mode and how to properly configure it according to your specific business needs.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/plumrocket.com\/learn\/magento-cookie-restriction-mode\" \/>\n<meta property=\"og:site_name\" content=\"Magento Tutorials for Beginners &amp; Professionals\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-18T09:24:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-10T08:10:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2023\/07\/Magento-2-Cookie-Restriction-Mode.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/posts\/1269"}],"collection":[{"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/comments?post=1269"}],"version-history":[{"count":5,"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/posts\/1269\/revisions"}],"predecessor-version":[{"id":1948,"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/posts\/1269\/revisions\/1948"}],"wp:attachment":[{"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/media?parent=1269"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/categories?post=1269"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/tags?post=1269"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}