DEV Community

Discussion on: How to make a Cookie Policy Banner without any npm package

nicozerpa profile image
Nico Zerpa (he/him)

Thank you for sharing Vicky! I'd like to add something important, which is not strictly related to tech:

A cookie notice, at least those that comply with GDPR, don't just tell users the site uses cookies. It also asks them for permission to use them. In fact, the site should not create cookies or data in local storage until the user accepts them (except for cookies that are necessary for the site to work.)

It means that the banner actually requires two buttons: one to accept cookies and another to reject them.

vikirobles profile image
Vicky V Author

Thanks Nico for your feedback. Yes, no worries, this is just a sample of showing how you can make a cookie without an npm package and how you can use localstorage. But again thanks.