codefog / contao-cookiebar

Display the information about cookies on your Contao website
MIT License
26 stars 9 forks source link

limit cookie lifetime to session #61

Closed birdmedia closed 6 years ago

birdmedia commented 6 years ago

Is it possible to limit the lifetime of the cookie "COOKIEBAR_" to the session? Right now the cookie expires after 20h by default, what makes it a persistent cookie.

qzminski commented 6 years ago

Not out of the box but you can use your own JS based on what can be found here: https://github.com/codefog/contao-cookiebar/blob/master/assets/src/cookiebar.js

Then simply adjust the template to include your scripts and that should do it: https://github.com/codefog/contao-cookiebar/blob/master/templates/cookiebar.html5

birdmedia commented 6 years ago

Works fine, thank you! Maybe it could be a feature to skip the "expires" parameter in order to create a session cookie?

qzminski commented 6 years ago

If there are more votes for this feature then I will definitely consider adding it 😉