buildo / react-cookie-banner

React Cookie banner which can be automatically dismissed with a scroll. Because fuck The Cookie Law, that's why.
http://react-components.buildo.io/#cookiebanner
MIT License
182 stars 19 forks source link

Cookie expiration date #23

Closed codeheroics closed 7 years ago

codeheroics commented 7 years ago

Hi,

The current cookie expiration date is set to 1 year after the acceptance of the cookie. Does the law require yearly approval, or is it just a default for the code? (and if so, couldn't the cookie be set with a much expiration date way later in time, so as to not bother users again a year after acceptance?)

FrancescoCioria commented 7 years ago

Hi @codeheroics Yes, currently the expiration date is hardcoded to 1 year

I think this is very opinionated but setting it to 10 years would be opinionated too :)

If you agree I can make it customizable through props and leave 1 year as default to avoid breaking changes. Would this be ok for you?

codeheroics commented 7 years ago

Yes, it would be great :)

FrancescoCioria commented 7 years ago

@codeheroics I just released v0.0.16 with the new prop cookieExpiration

cookieExpiration can be either an integer representing the seconds since its expiration or an object structured like this:

{
  years: ?Number,
  days: ?Number,
  hours: ?Number
}

the default remains one year ({ years: 1 }) to avoid adding a breaking change

codeheroics commented 7 years ago

Awesome, thanks! :)

gabro commented 7 years ago

@FrancescoCioria I just noticed the README wasn't updated. Can you take care of it?