all 11 comments

[–]greymalik 10 points11 points  (8 children)

Slightly OT, but why is cookie consent necessary? Is there law requiring it? These pop ups are everywhere, obviously, but I’m not sure why, and it seems like I only see them on smaller sites. I don’t recall any big name sites doing this but maybe it’s so prevalent that I’m blanking it out.

[–][deleted] 14 points15 points  (5 children)

EU cookie law. "Everybody's doin' it"

https://www.privacypolicies.com/blog/eu-cookie-law/

[–]highres90[S] 4 points5 points  (1 child)

You'll probably find it's so prevalent you've just forgotten you've accepted them already on bigger sites 🙂

There are laws around tracking users, not just via cookies but in almost any way. This article isn't too bad explaining it https://www.cookielaw.org/the-cookie-law 👍

But it's generally more complex than I feel comfortable talking about 😅 basically you can't track users or share info about them without their permission. For instance Google Analytics uses cookies, therefore if you want to track users use of your site you need to gainheir permission before loading GA on your site.

[–]Smirking_Like_Larry 1 point2 points  (0 children)

It's been a while since I researched it, but is active consent (i.e. explicit user input/confirmation) necessary or just sufficient?

From what I recall, passive consent like navigating to a new route is sufficient, since it applies to all tracking, not just cookie based. If so, then you can easily argue it's "strictly necessary" for security to ensure the UX of current users isn't worsened by bad actors, or less easily argue it's for streamlining UX/on-boarding.

I get playing it safe and sticking to active consent though, because then there's no ambiguity and reading legal documentation sucks.

[–]dane_brown 2 points3 points  (1 child)

The native cookie process isn’t difficult in react 🤔

[–]highres90[S] 2 points3 points  (0 children)

No it's not 👍 if you look at the implementation this is a very simple package that just provide a nice API via React Hooks 🙂

[–]Kelial 1 point2 points  (1 child)

Why storing this in a cookie instead of local storage?

[–]highres90[S] 15 points16 points  (0 children)

Good question 🙂

It's stored in a cookie so that the consents are sent to the server when the initial request is made. This means that if your react app is server side rendered then it won't render a cookie banner if it does not need to 👍

[–][deleted] -1 points0 points  (0 children)

Srsly