- Issue created by @tvb
- Merge request !9Issue 3468082: Set cookie expiration date 1000 days from current date instead of 1 day → (Open) created by tvb
- Issue was unassigned.
- Status changed to Needs review
3 months ago 9:03am 15 August 2024
Comment in /targets/js/targets.cookies.js states that cookie will expire in 1000 days, in reality it is only 1 day.
// The cookie will expire in 1000 days.
const date = new Date();
date.setTime(date.getTime() + 86400 * 1000);
document.cookie = `${cookieName}=${target}; expires=${date.toUTCString()}; path=/`;
Verify via browser console:
(function() {
const date = new Date();
date.setTime(date.getTime() + 86400 * 1000);
console.log(date.toUTCString());
})();
Replace date.setTime(date.getTime() + 86400 * 1000);
with date.setTime(date.getTime() + 86400 * 1000 * 1000);
.
Needs review
1.1
Code