pimterry / loglevel

:ledger: Minimal lightweight logging for JavaScript, adding reliable log level methods to wrap any available console.log methods
MIT License
2.61k stars 157 forks source link

GDPR: Add an option to disable cookie persistence #160

Closed Kureev closed 3 years ago

Kureev commented 3 years ago

Hi,

First of all, thank you for such an amazing project! We've been using it for a couple of years and it works like a charm ❤️ .

Recently, we discovered that loglevel might use cookies for persistence. While this sounds like an absolutely great idea, we should have an option to disable it. Having it always on would violate GDPR policy around "functional" cookies. Unless customer would allow this type of cookies, they should be blocked by default.

I checked the docs and it seems that currently there is only an option to disable persistence which I'd like to avoid and hence, asking you to consider adding this functionality to the lib. If you'd like to add such functionality to your lib, I can compose a PR addressing this. I might only need your opinion on on the naming 🤔, but the rest I can take myself.

pimterry commented 3 years ago

You should talk to your own legal/privacy team, but I'm fairly confident that:

Some more info here: https://law.stackexchange.com/a/30766. If there's a specific use case where you really do need to disable cookies to enforce usage of local storage only instead, I'd be super interested to hear about it and I'm happy to look into that, but AFAIK there's no privacy laws anywhere in the world that treat cookies differently to the other persistence features that loglevel uses.

Kureev commented 3 years ago

That's a great response, thank you! I'll double-check this with the legal team and come back to you 🙏

Kureev commented 3 years ago

Apparently, it will take time to figure this one out on our side. I'll close this ticket for now and reopen if applicable. Thank you so much for your help!

xmedeko commented 3 years ago

See #165