Skip to main content

Duration of CookieConsent 2020

Comments

5 comments

  • 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-cookie

     

    Regards,
    Spas

    0
  • Michael Kelly

    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

    0
  • Hi Michael Kelly,

    You could add the above mentioned script for reducing the duration of the CookieConsent cookie into the head tag of your site after the Cookiebot script (Cookiebot main script must be the first element to load in the head tag). 

    Regards,
    Spas

     

    0
  • Brian Mørkeberg Lundkvist

    As I understand from our product team this will soon make it into our solution as a built in feature. We expect to have this in place within the next month or two.

    0
  • ombline gilliot

    Hello,

    I reduced the duration of the CookieConsent-Cookie to 6 months in the script, shouldn't the duration of the necessary cookie be "6 months" and not one year as shown on the attached screenshot ? "Expiration: 1 année"

    0

Please sign in to leave a comment.