empreinte-digitale / orejime

An easy to use consent manager that focuses on accessibility.
https://orejime.empreintedigitale.fr/
Other
155 stars 26 forks source link

Custom cookie duration based on consents #78

Open gtnsimon opened 2 years ago

gtnsimon commented 2 years ago

To offer more control to developers on how cookie duration is managed based on user consent, is it possible to allow cookieExpiresAfterDays to be a function ?

This function could take 2 arguments:

Motivations

I'm working with orejime on general public websites which requires this kind of behavior especially for users who click decline on Notice or decline all on Modal. It is a pure business needs but it gives more control than a static value.

felixgirault commented 2 years ago

This seems like a legit use-case, thank you for the PR. I just made some small requests for adjustments, let me know what you think.