Bug 33597: Fix deleting cookie for holdfor(club)

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 <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7e5e311cb0)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Marcel de Rooy 2023-04-24 10:35:26 +00:00 committed by Martin Renvoize
parent d11c9fec33
commit d8567143ee
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
2 changed files with 3 additions and 3 deletions

View File

@ -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("<a class=\"btn btn-default btn-xs placehold\" href=\"#\"><i class=\"fa fa-sticky-note-o\"></i> " + __("Place hold") + "</a>");
}

View File

@ -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(){