Skip to content

Commit

Permalink
Merge pull request #31 from hphoeksma/master
Browse files Browse the repository at this point in the history
Bugfix: safari on http does not persist cookie
  • Loading branch information
Nikdro committed Oct 7, 2021
1 parent c9920c7 commit 271ce94
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Resources/Public/JavaScript/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ function saveConsentToCookie(inputs, userId) {
expireDate: expireDate.toUTCString()
};

var cookieParams = encodeURI(JSON.stringify(cookieData)) + "; expires=" + expireDate.toUTCString() + "; path=/; " + (KD_GDPR_CC.cookieDomainName ? ('domain=' + KD_GDPR_CC.cookieDomainName + ';') : '') +" Secure;";
var cookieParams = encodeURI(JSON.stringify(cookieData)) + "; expires=" + new Date(currentDate.getTime() + 315360000000).toUTCString() + "; path=/; " + (KD_GDPR_CC.cookieDomainName ? ('domain=' + KD_GDPR_CC.cookieDomainName + ';') : '') + (location.protocol.substring(0,5) === 'https' ? " Secure;" : '');
document.cookie = KD_GDPR_CC.cookieName + "=" + cookieParams;

window.dataLayer = window.dataLayer || [];
Expand Down

0 comments on commit 271ce94

Please sign in to comment.