dobarkod / cookie-banner

JavaScript based cookie-info banner for complying with EU cookie law
MIT License
425 stars 85 forks source link

Expiration #23

Closed peterampazzo closed 7 years ago

peterampazzo commented 9 years ago

How can I set the inspiration up to 24 hours?

zytzagoo commented 9 years ago

Depends on the way you invoke/create it. This should work as a rough example:

<script>
function cookie_expiry_callback() {
    return 86400; // 1 day (24 hours in seconds)
}
</script>

<script type="text/javascript" id="cookiebanner"
    src="//cookiebanner.eu/js/cookiebanner.js"
    ...
    data-expires="cookie_expiry_callback">
</script>

If you're creating a new Cookiebanner() yourself then just set the expires option.

Reading through (and running, potentially) the tests sources might also help.