Skip to main content

Duration of CookieConsent

Comments

7 comments

  • Official comment
    Brian Mørkeberg Lundkvist

    It is currently not possible to set custom expiration time on the CookieConsent cookie. Product management has been made aware of this feature request and we will evaluate for potential inclusion in a future release.

  • Martin Iv. – vConnect

     

    Hey Robert, 

    Please note that the Cookiebot banner will automatically renew consents (i.e. the cookie consent banner will reappear and the user be asked for a new consent) after 12 months. So we do list the expiration dates for the various cookies (everything from seconds to multiple years) but the consent will be renewed as required after 12 months - regardless of what the expiration date of the individual cookies are. 

    You can check this out here: https://support.cookiebot.com/hc/en-us/articles/360004553893-Renew-existing-user-consents

    You should start a rescan of the site to update the lifetime on the cookie declaration. The new scan can be initiated manually, which is done by clicking the “Scan domain now” button, which you will find in the “Cookies” menu of the Cookiebot Manager.

    Kind regards,
    Martin

    0
  • Ovidiu Repanovici

    So, is it possible to set the duration of the CookieConsent-Cookie to Session ?

    0
  • Claus Harup

    I have the excact same question; is it possible to set the duration of the CookieConsent-Cookie to Session ?

    0
  • Müller, Sascha

    Hey,
    since the answer is now 9 month old:

    Is it now possible to set a custom exporation time like session or 14 days?

    Kind regards,

    Sascha

    0
  • Hi,

    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
  • helps mew

    Looking for help with this too. This comes up in PCI vulnerability scans. Rather than implement an SRI hash test on our own, we might favor to have SRI natively supported by way of cookiebot, if possible.

    0

Please sign in to leave a comment.