| Summary: | Create sub clear_session_and_cookies | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Marcel de Rooy <m.de.rooy> |
| Component: | Authentication | Assignee: | Bugs List <koha-bugs> |
| Status: | NEW --- | QA Contact: | Testopia <testopia> |
| Severity: | enhancement | ||
| Priority: | P5 - low | CC: | dcook, dpavlin, jonathan.druart |
| Version: | Main | ||
| Hardware: | All | ||
| OS: | All | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Comma delimited list of Sponsors: | |
| Crowdfunding goal: | 0 | Patch complexity: | --- |
| Documentation contact: | Documentation submission: | ||
| Text to go in the release notes: | Version(s) released in: | ||
| Circulation function: | |||
| Bug Depends on: | 28786, 29957 | ||
| Bug Blocks: | |||
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 ); }