From bc070c05d754c971c587d4f1fff1a034e72e2971 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Mon, 22 Nov 2021 11:18:27 +0100 Subject: [PATCH] =?UTF-8?q?Sp=C3=A9cification=20du=20domaine=20et=20du=20c?= =?UTF-8?q?hemin=20dans=20le=20cookie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core.js.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/core.js.php b/core/core.js.php index 831967bf..09396ebc 100644 --- a/core/core.js.php +++ b/core/core.js.php @@ -239,7 +239,8 @@ core.start = function() { var expires = new Date(); expires.setFullYear(expires.getFullYear() + 1); expires = "expires=" + expires.toUTCString(); - document.cookie = "ZWII_COOKIE_CONSENT=true;path:/;samesite=lax;" + expires; + var getUrl = window.location; + document.cookie = "ZWII_COOKIE_CONSENT=true;domain=" + getUrl.host + ";path=" + getUrl.pathname.split('/')[1] + ";samesite=strict;" + expires; // Ferme le message $(this).parents("#cookieConsent").fadeOut(); }), @@ -251,7 +252,8 @@ core.start = function() { var expires = new Date(); expires.setFullYear(expires.getFullYear() + 1); expires = "expires=" + expires.toUTCString(); - document.cookie = "ZWII_COOKIE_CONSENT=false;path:/;samesite=lax;" + expires; + var getUrl = window.location; + document.cookie = "ZWII_COOKIE_CONSENT=true;domain=" + getUrl.host + ";path=" + getUrl.pathname.split('/')[1] + ";samesite=strict;" + expires; // Ferme le message $(this).parents("#cookieConsent").fadeOut(); }),