Duration of CookieConsent 2020
Hello,
Is it possible to change the duration of the CookieConsent-Cookie to a custom duration?
As you must know, in some countries consent cannot be held more than 6 months (not to be confused with the 13 months cookies conservation), it should be possible to ask consent again automatically every 6 months.
The manual renewal of all consents is not precise enough.
Thanks!
-
Hi ombline gilliot,
By default the cookie that remembers a user's consent (CookieConsent) has a lifespan of 12 months.
But, you could reduce or increase the duration of the CookieConsent cookie by adding this script to the page:<script type="text/javascript">
window.addEventListener("CookiebotOnLoad", function() {
var cookies = document.cookie.split(";"),
d = new Date(),
days = 365, // Define number of days after which the cookie should expire here
utc = 0;
d.setTime(d.getTime() + (days * 24 * 60 * 60 * 1000));
var expires = "expires=" + d.toUTCString();
for(i of cookies) {
if (i.indexOf("CookieConsent") != -1) {
utc = i.match(/(?:utc:)(\d{13})/)[1];
utc && 2500 > utc - Date.now() && (document.cookie = i + ";" + expires + ";path=/");
}
}
}, false);
</script>However, you could also renew user consents manually from your CookieBot account. Just go to the menu point 'User consents', then choose the domain group and at the bottom of the page, you will find instructions and a button saying 'Renew now'.
You could find more information about this topic at the following links:
https://support.cookiebot.com/hc/en-us/articles/360004553893-Renew-existing-user-consents
https://support.cookiebot.com/hc/en-us/articles/360012745519-Reducing-the-lifespan-of-the-CookieConsent-cookieRegards,
Spas -
Hi,
In Ireland the GDPR states that Cookie Consent should be no longer than 6 months. I See there is a script above to change the duration of the Cookie Consent. Can you please tell me, where to put this script? Should it be in the <head> with the Cookiebot script? and if so, is it put before or after the Cookiebot script?
Regards
Michael
Please sign in to leave a comment.
Comments
4 comments