From 208f1021255f388418135ea0aac4e4e4258d0525 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 21 Dec 2017 17:15:43 -0300 Subject: [PATCH] Bug 18975: Retrieve up-to-date CGISESSID when just logged in If a user is asked to login before sending a card, the wrong (old) CGISESSID cookie is used. We need to retrieve the one that has just been created. This will certainly need more work, I guess other scripts are affected too. Signed-off-by: Claire Gravely Signed-off-by: Jonathan Druart --- opac/opac-sendbasket.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/opac/opac-sendbasket.pl b/opac/opac-sendbasket.pl index 6ae9dfe938..09c462c8dc 100755 --- a/opac/opac-sendbasket.pl +++ b/opac/opac-sendbasket.pl @@ -192,13 +192,14 @@ END_OF_BODY output_html_with_http_headers $query, $cookie, $template->output; } else { + my $new_session_id = $cookie->value; $template->param( bib_list => $bib_list, url => "/cgi-bin/koha/opac-sendbasket.pl", suggestion => C4::Context->preference("suggestion"), virtualshelves => C4::Context->preference("virtualshelves"), csrf_token => Koha::Token->new->generate_csrf( - { session_id => scalar $query->cookie('CGISESSID'), } ), + { session_id => $new_session_id, } ), ); output_html_with_http_headers $query, $cookie, $template->output; } -- 2.39.5