From 1628922e748e90240abaa63ca34a649b1ce598d8 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Mon, 24 Apr 2023 10:35:26 +0000 Subject: [PATCH] Bug 33597: Fix deleting cookie for holdfor(club) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolve: Cookie “holdfor” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. Did not see warning for holdforclub. But since it is created with Lax, we should remove it with Lax. Test plan: Similar to previous patch. Check console on logout page. Signed-off-by: Marcel de Rooy Signed-off-by: Nick Clemens --- koha-tmpl/intranet-tmpl/prog/js/pages/results.js | 4 ++-- koha-tmpl/intranet-tmpl/prog/js/staff-global.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/pages/results.js b/koha-tmpl/intranet-tmpl/prog/js/pages/results.js index 2e381c2260..8ce456e3fd 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/pages/results.js +++ b/koha-tmpl/intranet-tmpl/prog/js/pages/results.js @@ -356,8 +356,8 @@ function placeHold () { } function forgetPatronAndClub(){ - Cookies.remove("holdfor", { path: '/' }); - Cookies.remove("holdforclub", { path: '/' }); + Cookies.remove("holdfor", { path: '/', SameSite: 'Lax' }); + Cookies.remove("holdforclub", { path: '/', SameSite: 'Lax' }); $(".holdforlink").remove(); $("#placeholdc").html(" " + __("Place hold") + ""); } diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js index 3b60c4b938..c4890ae20e 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js +++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js @@ -237,7 +237,7 @@ function checkEnter(e){ //e is event object passed from function invocation } function clearHoldFor(){ - Cookies.remove("holdfor", { path: '/' }); + Cookies.remove("holdfor", { path: '/', SameSite: 'Lax' }); } function logOut(){ -- 2.30.2