Possible follow-up of 29957 Something like: =head2 clear_session_and_cookies ( $session, $sessionID, $cookie ) = clear_session_and_cookies( $session, $sessionID, $cookie, $mgr, $cgi ); =cut sub clear_session_and_cookies { my ( $session, $sessionID, $cookie, $mgr, $cgi ) = @_; $mgr //= Koha::CookieManager->new; $session->delete; $session->flush; my @list = ref($cgi) eq 'CGI' ? $cgi->cookie : (); push @list, @$cookie if ref($cookie) eq 'ARRAY'; $cookie = $cookie_mgr->clear_unless( @list ); C4::Context::_unset_userenv($sessionID); return ( undef, undef, $cookie ); }
on top of bug 28786 maybe?