mirror of https://github.com/status-im/fathom.git
expire tracking cookie at local midnight, not utc midnight. fixes issue with immediate cookie expiration on negative utc offsets
This commit is contained in:
parent
0d5c5066aa
commit
4028dcab68
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue