From 6f9bc5d41c46769d3667e94f6fce6d32d9f9ad17 Mon Sep 17 00:00:00 2001 From: Eduardo Silva Date: Tue, 17 Jun 2025 15:04:45 -0300 Subject: [PATCH] extend router list cookie expiration to 1 year --- templates/router_manager/router_list.html | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/templates/router_manager/router_list.html b/templates/router_manager/router_list.html index 011f45f..a211271 100644 --- a/templates/router_manager/router_list.html +++ b/templates/router_manager/router_list.html @@ -380,15 +380,13 @@ $(document).ready(function() { } function setCookie(name, value, days) { - var expires = ""; + let expires = ""; if (days) { - var date = new Date(); - // Calculate expiration date: current date + days (in milliseconds) + const date = new Date(); date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); expires = "; expires=" + date.toUTCString(); } - // Set the cookie with the calculated expiration date - document.cookie = name + "=" + encodeURIComponent(value) + expires + "; path=/; max-age=" + (days * 24 * 60 * 60); + document.cookie = name + "=" + encodeURIComponent(value) + expires + "; path=/"; } function getVisibleColumns() { @@ -439,7 +437,7 @@ $(document).ready(function() { }); // Save to cookie - setCookie('router_visible_columns', JSON.stringify(selectedColumns), 90); + setCookie('router_visible_columns', JSON.stringify(selectedColumns), 365); // Reload the page with the same GET parameters var currentUrl = window.location.href;