Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cconsent cookie expires after 7 days - can it be longer? #126

Open
paulburgess opened this issue May 1, 2024 · 1 comment
Open

cconsent cookie expires after 7 days - can it be longer? #126

paulburgess opened this issue May 1, 2024 · 1 comment

Comments

@paulburgess
Copy link

Hi, currenlty the preferences stored in the 'cconsent' cookie expire after 7 days so the user has to set them again. Is there a GDPR reason for that? I looked but couldn't see any option to alter that date via the options.

Is there a way to extend this to a year?

Many thanks!

@MontiMarco92
Copy link
Collaborator

I don't see anything indicating the cconsent cookie to expire after 7 days. In fact, it's set to expire after a year.

setCookie(cookie, callback) {
    const expires_in = new Date(Date.now() + 365 * 24 * 60 * 60 * 1000).toUTCString();

    document.cookie = `cconsent=${JSON.stringify(cookie)}; expires=${expires_in}; path=/;`;
    window.CookieConsent.config.cookieExists = true
    if (callback) callback();
  }

image

But maybe I'm missing something. What do you think @l-besenyei ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants