mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 07:46:23 -04:00
Merge pull request #3404 from alphagov/fix-time-in-cookies-tests
Fix timestamp used for clearing old cookies
This commit is contained in:
@@ -9,14 +9,14 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|||||||
|
|
||||||
// clear old cookie set by our previous JS, set on the www domain
|
// clear old cookie set by our previous JS, set on the www domain
|
||||||
if (window.GOVUK.cookie('seen_cookie_message')) {
|
if (window.GOVUK.cookie('seen_cookie_message')) {
|
||||||
document.cookie = 'seen_cookie_message=;expires=' + new Date() + ';path=/';
|
document.cookie = 'seen_cookie_message=;expires=' + new Date().toGMTString() + ';path=/';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (consent === null) {
|
if (consent === null) {
|
||||||
for (var i = 0; i < gaCookies.length; i++) {
|
for (var i = 0; i < gaCookies.length; i++) {
|
||||||
if (window.GOVUK.cookie(gaCookies[i])) {
|
if (window.GOVUK.cookie(gaCookies[i])) {
|
||||||
// GA cookies are set on the base domain so need the www stripping
|
// GA cookies are set on the base domain so need the www stripping
|
||||||
var cookieString = gaCookies[i] + '=;expires=' + new Date() + ';domain=' + window.location.hostname.replace(/^www\./, '.') + ';path=/';
|
var cookieString = gaCookies[i] + '=;expires=' + new Date().toGMTString() + ';domain=' + window.location.hostname.replace(/^www\./, '.') + ';path=/';
|
||||||
document.cookie = cookieString;
|
document.cookie = cookieString;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user