Something went wrong.
Or, if you don’t want to limit to only cookie compliance law but make your Magento 2 store compatible with the GDPR law, have a look at Magento 2 GDPR extension!
Feel free to share the solution with Magento Community via social media.
Thank you for subscribing.
I would be happy to help.
Follow the below method to Enable Cookie Restriction Mode in Magento 2.
Method to Enable Cookie Restriction Mode in Magento 2
- Login to Magento 2 admin panel.
- Navigate to “Stores > Settings > Configuration”.
- Expand the “Default Cookie Settings” section.
- Enter the “Cookie Lifetime” in seconds.
- Enter the “Cookie Path” if you want to make cookies available to other folders. Enter a forward slash to make the cookies available anywhere on the site.
- Enter the subdomain name in the “Cookie Domain” field to make the cookies available to a subdomain.
- Set YES to “Use HTTP Only” to prevent scripting languages from gaining access to cookies.
- Set YES to “Cookie Restriction Mode”.
- Save the configuration by clicking the “Save Config” button.
Hence, the default Magento 2.4.x versions have introduced the feature to enable cookie restriction mode in Magento 2 store from the backend.
Never miss Magento tips, tricks, tutorials, and news.
However, prior to using the customers’ data, it is mandatory to have their consent for the same.
Cookie Notice helps to implement cookie compliance in Magento 2 store. The notification bar displays a cookie restriction message and contains a button “Allow Cookies” as shown below.
Cookies help store owners track the customers’ behaviour and hence enhance their on-site experience.
Cookies are small text files stored in a web user’s browser directory or data folder that has user’s data like username, password, and browsing history.
Get Weekly Updates
However, if you are using older versions of Magento 2 and want to implement cookie notice in your store, you can opt for Meetanshi’s FREE Magento 2 Cookie Notice extension that shows a neat and simple cookie notification bar or popup in the store frontend which can be even customized as per your theme!
If you have any doubts regarding this post, just mention them in the Comments section below.
(Image Source: Magento 2.4 Devdocs)