From 591646d0901a6869f327701328df79db8f779611 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 20 Feb 2024 14:10:40 +0100 Subject: [PATCH] Bug 36102: Remove cookie from the installer session Signed-off-by: Jonathan Druart --- installer/install.pl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/installer/install.pl b/installer/install.pl index a35b98045d..afb8015d9c 100755 --- a/installer/install.pl +++ b/installer/install.pl @@ -231,8 +231,18 @@ elsif ( $step && $step == 3 ) { # Remove the HandleError set at the beginning of the installer process C4::Context->dbh->disconnect; + my $cookie_mgr = Koha::CookieManager->new; + # Remove cookie of the installer session + $cookie = $cookie_mgr->replace_in_list( $cookie, $query->cookie( + -name => 'CGISESSID', + -value => '', + -HttpOnly => 1, + -secure => ( C4::Context->https_enabled() ? 1 : 0 ), + -sameSite => 'Lax', + )); + # we have finished, just redirect to mainpage. - print $query->redirect("/cgi-bin/koha/mainpage.pl"); + print $query->redirect( -uri => "/cgi-bin/koha/mainpage.pl", -cookie => $cookie ); exit; } elsif ( $op eq 'cud-finish' ) { -- 2.39.2