Making my blog zero cookie
Table of Contents
Local storage and exceptions #
First, it’s important to understand the difference between Cookies, Tracking cookies and Local Storage. It seems obvious, but it isn’t.
Cookies are a web standard that exists since 1995. Cookies are stored in the user browser and can be automatically sent to servers when making a request.
Tracking Cookies are Cookies used in requests in order to track the user during its browsing activities (I know it may sound obvious, but keep reading).
Local storage is a web standard that was introduced along with HTML5 in 2008. Different from Cookies, Local Storage is not automatically sent with requests and
So, that’s the first part of the controversy. The “Cookie Banner” some websites out there are using is to grant permission for Tracking Cookies, in observance to ePrivacy Directive, GDPR, CCPA and other privacy laws in the World.
That means, if a user chooses not to be tracked via cookies, you definitely can store a boolean cookie in user’s browser (although it would be wiser to use Local Storage) to save their preference for not being tracked, thus preventing the cookie consent from showing up again. The “Cookie Banner” is not about all the cookies, it’s about the Tracking Cookies — and even the definition of a “Tracking Cookie” depends on the context in which they’re used.
But, I want my website to stay faithful to the Zero Cookie promise, so any data I may want to store on the browser, I’m storing as Local Storage, so it’s not even sent to my webserver. That’s the case for the dark/light theme preference (the toggle is at the footer) — And even that is only saved if the user chooses to user a theme different from the default one informed by the browser.
Disclaimer: that was already the default behavior of the Congo theme I’ve used as base for my website.
So, let’s keep this in mind: Zero Cookie is not “Zero Local Storage”.
Analytics #
Every website owner wants analytics