[Koha-bugs] [Bug 30348] New: Create sub clear_session_and_cookies

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Mar 24 11:41:50 CET 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30348

            Bug ID: 30348
           Summary: Create sub clear_session_and_cookies
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: Authentication
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: m.de.rooy at rijksmuseum.nl
        QA Contact: testopia at bugs.koha-community.org
                CC: dpavlin at rot13.org

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 );
}

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.


More information about the Koha-bugs mailing list