@@ -, +, @@ --- C4/Auth.pm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) --- a/C4/Auth.pm +++ a/C4/Auth.pm @@ -178,6 +178,29 @@ sub get_template_and_user { ); } + + # If the user logged in is the SCO user and he tries to go out the SCO module, log the user out removing the CGISESSID cookie + if ( $in->{type} eq 'opac' and $in->{template_name} !~ m|sco/| ) { + if ( C4::Context->preference('AutoSelfCheckID') && $user eq C4::Context->preference('AutoSelfCheckID') ) { + $template = C4::Templates::gettemplate( 'opac-auth.tt', 'opac', $in->{query} ); + my $cookie = $in->{query}->cookie( + -name => 'CGISESSID', + -value => '', + -expires => '', + -HttpOnly => 1, + ); + + $template->param( loginprompt => 1 ); + print $in->{query}->header( + -type => 'text/html', + -charset => 'utf-8', + -cookie => $cookie, + ), + $template->output; + safe_exit; + } + } + my $borrowernumber; if ($user) { require C4::Members; --