From 8e29e0f106bc625bf9dcd9574f3636d56989939f 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 c51e8c434d..ab03e52ab7 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