changing cookie lifetime to 30 days

This commit is contained in:
Antoine M 2024-08-07 16:48:32 +02:00
parent 22250aeb26
commit 1d6a6e192b

View File

@ -11,8 +11,8 @@ export default function NotificationsInit() {
notificationClose.addEventListener('click', () => {
notification.classList.add('notification--dismissed');
document.cookie = `${notificationId}=dismissed; path=/; max-age=30`;
// document.cookie = `${notificationId}=dismissed; path=/; max-age=${30 * 86400}`; // 86400 = 1 day
const thirtyDays = 30 * 86400;
document.cookie = `${notificationId}=dismissed; path=/; max-age=${thirtyDays}`;
});
});
}