Problem: Cookies reset on every page publish

I use a custom code to show a cookie notification ( European cookie law etc ).
It is very annoying that the cookie always resets when I “republish” the site.
Do you know a way around that?

My custom code is:

var Webflow = Webflow || [];
Webflow.push(function() {

  // Load cookie library
  function() {

    // If cookie found (already shown)
    if(Cookies.get('notice') !== undefined) {

      // Hide cookie notice (change jQuery selector to match your own)
    // On button click
    $('.w-button').click(function() {
      // Calculate when you want to display the notice again (change 15 to number of minutes you want)
      var expireTime = new Date(new Date().getTime() + 60000000 * 100800);
      // Set this cookie
      Cookies.set('notice', 'shown', { expires: expireTime });

<!--End Cookie Script-->

This topic was automatically closed after 60 days. New replies are no longer allowed.