From 7da12be242d33e09717e6d01fbf3a6cedd5a17ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Tempez?= Date: Sun, 15 Sep 2024 19:00:53 +0200 Subject: [PATCH] modification du cookie de consentement --- core/core.js.php | 8 +++++--- core/module/config/view/index/index.js.php | 1 - 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/core/core.js.php b/core/core.js.php index 90e354a3..ee063b9f 100644 --- a/core/core.js.php +++ b/core/core.js.php @@ -216,12 +216,14 @@ core.start = function () { // Variables des cookies var getUrl = window.location; var domain = "domain=" + getUrl.hostname + ";"; + var basePath = getUrl.pathname.substring(0, getUrl.pathname.lastIndexOf('/') + 1); + var path = "path=" + basePath + ";"; var e = new Date(); e.setFullYear(e.getFullYear() + 1); - var expires = "expires=" + e.toUTCString(); - + var expires = "expires=" + e.toUTCString() + ";"; + // Stocke le cookie d'acceptation - document.cookie = "ZWII_COOKIE_CONSENT=true;samesite=strict;" + domain + expires; + document.cookie = "ZWII_COOKIE_CONSENT=true; samesite=lax; " + domain + path + expires; }); diff --git a/core/module/config/view/index/index.js.php b/core/module/config/view/index/index.js.php index 3beb568c..603a59a3 100644 --- a/core/module/config/view/index/index.js.php +++ b/core/module/config/view/index/index.js.php @@ -265,7 +265,6 @@ $(document).ready(function () { $('span#screenWeight').each(function(index){ var weight = parseFloat($(this).text()); var fileType = $('span#screenType').eq(index).text(); -console.log(weight); if ((fileType === "jpg" || fileType === "jpeg") && weight < 5000000) { $(this).css("color", "green"); } else {