diff --git a/core/core.js.php b/core/core.js.php index 0f3343f2..afceb326 100644 --- a/core/core.js.php +++ b/core/core.js.php @@ -212,12 +212,11 @@ core.start = function() { */ $("#cookieForm").submit(function(event){ - // Varables des cookies - var samesite = "samesite=lax"; + // Variables des cookies var getUrl = window.location; - var domain = "domain=" + getUrl.host; - var path = "path=" + getUrl.pathname.split('/')[1]; - var samesite = "samesite=lax"; + var domain = "domain=" + getUrl.host + ";"; + var path = "path=" + getUrl.pathname.split('/')[1] + ";"; + var e = new Date(); e.setFullYear(e.getFullYear() + 1); var expires = "expires=" + e.toUTCString(); @@ -226,18 +225,18 @@ core.start = function() { var analytics = "getData(['config', 'seo', 'analyticsId']);?>"; // l'Id GA est défini dans la configuration, afficher la checkbox d'acceptation if( analytics.length > 0){ - // Traitement du retour de la checkbox + // Traitement du retour de la checkbox if ($("#googleAnalytics").is(":checked")) { // L'URL du serveur faut TRUE - document.cookie = "ZWII_COOKIE_GA_CONSENT=true;" + domain + ";" + path + ";" + samesite + ";" + expires; + + document.cookie = "ZWII_COOKIE_GA_CONSENT=true;samesite=strict;" + domain + path + expires; } else { - document.cookie = "ZWII_COOKIE_GA_CONSENT=false;" + domain + ";" + path + ";" + samesite + ";" + expires; + document.cookie = "ZWII_COOKIE_GA_CONSENT=false;samesite=strict;" + domain + path + expires; } } - // Stocke le cookie d'acceptation - document.cookie = "ZWII_COOKIE_CONSENT=true;" + domain + ";" + path + ";" + samesite + ";" + expires; + document.cookie = "ZWII_COOKIE_CONSENT=true;samesite=strict;" + domain + path + expires; });