Duration of CookieConsent 2020

Comments

1 comment

  • 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
    Comment actions Permalink

Please sign in to leave a comment.