Lines 48-53
use Encode;
Link Here
|
48 |
use C4::Auth_with_shibboleth qw( shib_ok get_login_shib login_shib_url logout_shib checkpw_shib ); |
48 |
use C4::Auth_with_shibboleth qw( shib_ok get_login_shib login_shib_url logout_shib checkpw_shib ); |
49 |
use Net::CIDR; |
49 |
use Net::CIDR; |
50 |
use C4::Log qw( logaction ); |
50 |
use C4::Log qw( logaction ); |
|
|
51 |
use Koha::CookieManager; |
51 |
|
52 |
|
52 |
# use utf8; |
53 |
# use utf8; |
53 |
|
54 |
|
Lines 807-821
sub _timeout_syspref {
Link Here
|
807 |
return $timeout; |
808 |
return $timeout; |
808 |
} |
809 |
} |
809 |
|
810 |
|
810 |
sub clear_all_cookies { |
|
|
811 |
my ( $query ) = shift; |
812 |
my @cookies; |
813 |
for my $cookie_name ( $query->cookie ) { |
814 |
push @cookies, $query->cookie( -name => $cookie_name, -value => '', -expires => '', -HttpOnly => 1 ); |
815 |
} |
816 |
return \@cookies; |
817 |
} |
818 |
|
819 |
sub checkauth { |
811 |
sub checkauth { |
820 |
my $query = shift; |
812 |
my $query = shift; |
821 |
|
813 |
|
Lines 846-851
sub checkauth {
Link Here
|
846 |
my $dbh = C4::Context->dbh; |
838 |
my $dbh = C4::Context->dbh; |
847 |
my $timeout = _timeout_syspref(); |
839 |
my $timeout = _timeout_syspref(); |
848 |
|
840 |
|
|
|
841 |
my $cookie_mgr = Koha::CookieManager->new; |
842 |
|
849 |
_version_check( $type, $query ); |
843 |
_version_check( $type, $query ); |
850 |
|
844 |
|
851 |
# state variables |
845 |
# state variables |
Lines 921-927
sub checkauth {
Link Here
|
921 |
my $shibSuccess = C4::Context->userenv->{'shibboleth'}; |
915 |
my $shibSuccess = C4::Context->userenv->{'shibboleth'}; |
922 |
$session->delete(); |
916 |
$session->delete(); |
923 |
$session->flush; |
917 |
$session->flush; |
924 |
$cookie = clear_all_cookies($query); |
918 |
$cookie = $cookie_mgr->clear_unless( $query->cookie, @$cookie ); |
925 |
C4::Context::_unset_userenv($sessionID); |
919 |
C4::Context::_unset_userenv($sessionID); |
926 |
$sessionID = undef; |
920 |
$sessionID = undef; |
927 |
|
921 |
|
928 |
- |
|
|