diff --git a/static/skin/index.js b/static/skin/index.js index 81ddc971..de047f59 100644 --- a/static/skin/index.js +++ b/static/skin/index.js @@ -46,10 +46,14 @@ return (url); } - function setCookie(cookieName, cookieValue) { - const date = new Date(); - date.setTime(date.getTime() + oneDayDelta); - document.cookie = `${cookieName}=${cookieValue};expires=${date.toUTCString()};sameSite=Strict`; + function setCookie(cookieName, cookieValue, ttl) { + let exp = ""; + if ( ttl ) { + const date = new Date(); + date.setTime(date.getTime() + ttl); + exp = `expires=${date.toUTCString()};`; + } + document.cookie = `${cookieName}=${cookieValue};${exp}sameSite=Strict`; } function getCookie(cookieName) { @@ -375,7 +379,7 @@ if (filterType) { params.set(filterType, filterValue); window.history.pushState({}, null, `?${params.toString()}`); - setCookie(filterCookieName, params.toString()); + setCookie(filterCookieName, params.toString(), oneDayDelta); } updateFilterColors(); updateFeedLink(); @@ -520,7 +524,7 @@ } } updateFeedLink(); - setCookie(filterCookieName, params.toString()); + setCookie(filterCookieName, params.toString(), oneDayDelta); }; // required by i18n.js:setUserLanguage() diff --git a/test/server.cpp b/test/server.cpp index 17eaaaf0..8e1393c1 100644 --- a/test/server.cpp +++ b/test/server.cpp @@ -63,7 +63,7 @@ const ResourceCollection resources200Compressible{ { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/index.css" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/index.css?cacheid=ac5767d8" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/index.js" }, - { STATIC_CONTENT, "/ROOT%23%3F/skin/index.js?cacheid=c333bdba" }, + { STATIC_CONTENT, "/ROOT%23%3F/skin/index.js?cacheid=2f15ed7d" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/iso6391To3.js" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/iso6391To3.js?cacheid=ecde2bb3" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/isotope.pkgd.min.js" }, @@ -284,7 +284,7 @@ R"EXPECTEDRESULT( href="/ROOT%23%3F/skin/index.css?cacheid=ac5767d8" - + )EXPECTEDRESULT" },