expire tracking cookie at local midnight, not utc midnight. fixes issue with immediate cookie expiration on negative utc offsets

This commit is contained in:
Danny van Kooten 2018-02-01 21:51:12 -09:00
parent 0d5c5066aa
commit 4028dcab68
1 changed files with 1 additions and 1 deletions

View File

@ -111,7 +111,7 @@ function trackPageview() {
i.src = trackerUrl + util.stringifyObject(d); i.src = trackerUrl + util.stringifyObject(d);
i.addEventListener('load', function() { i.addEventListener('load', function() {
let now = new Date(); let now = new Date();
let midnight = new Date(Date.UTC(now.getFullYear(), now.getMonth(), now.getDate(), 24, 0, 0)); let midnight = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 24, 0, 0);
let expires = Math.round((midnight - now) / 1000); let expires = Math.round((midnight - now) / 1000);
// update data in cookie // update data in cookie