Reset Cookie Consent Message

2.1k Views Asked by At

So I use a standard Cookie Consent on my pages generated by https://cookieconsent.insites.com/download/ Though I would like that the cookie consent reappears every time someone loads the site.

2

There are 2 best solutions below

0
On BEST ANSWER

it may not such a clean way but it deletes / resets the cookie

    <?php
// set the expiration date to one hour ago
setcookie("COOKIENAME", "", time() - 3600);
?>
6
On

Look at the Documentation at https://cookieconsent.insites.com/documentation/javascript-api/

According to this it should be something like:

window.cookieconsent.initialise({
  "cookie": {
    expiryDays: 0
  },
  "palette": {
    "popup": {
      "background": "#000"
    },
    "button": {
      "background": "#f1d600"
    }
  }
});

So set cookie.expiryDaysto 0 maybe should do the job.