Check if cookie exist before purge

This commit is contained in:
Amauri CHAMPEAUX 2021-05-20 18:59:08 +02:00
parent e762602f12
commit d3b6f63e5b
1 changed files with 7 additions and 3 deletions

View File

@ -1534,10 +1534,14 @@ var tarteaucitron = {
var i;
for (i = 0; i < arr.length; i += 1) {
var rgxpCookie = new RegExp("^(.*;)?\\s*" + arr[i] + "\\s*=\\s*[^;]+(.*)?$");
if (document.cookie.match(rgxpCookie)) {
document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/;';
document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location.hostname + ';';
document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location.hostname.split('.').slice(-2).join('.') + ';';
}
}
},
"checkCount": function (key) {
"use strict";