Going cookieless with Laravel
Laravel & Cookies, I bet you have it lying somewhere.
But does it need to be like that?
I mean do we have to use cookies?
Yes, I know… It is enabled, by default. But. Really. Does every website needs them?
Do you USE cookies? #
Let’s find out if you use cookies at all.
You are heavily using cookies on your website, I mean heavy: setting some popup states, visit states, tracking, bashing, and smashing all over the place?
Or heavily rely on session storage?
Have some forms on the website?
Then you probably use it.
Benefits of going cookieless #
Performance gains #
A website that does not use cookies and sessions gains some marginal performance, as it doesn’t need to calculate and invalidate old sessions.
Caching #
The cookieless website has a great potential to use static caching, which leads to great performance improvements and decreased load to your origin server.
More on this topic here.
Could be more, but those two are my main drivers for ditching cookies.
Should you go cookieless? #
- Want to ditch that cookie consent for Europe (EU)?
- Want more website performance?
- Want to remove the necessary code from the website?
Then go for it.
How you can go cookieless? #
- Offload your forms.
- Implement cookieless tracking.
- Do not rely on sessions.
Those are the first steps you could take, it could be more.
It depends on your case.
As always.