diff --git a/svc/config/systempreferences b/svc/config/systempreferences index ff2d45ffb2..794f796009 100755 --- a/svc/config/systempreferences +++ b/svc/config/systempreferences @@ -24,6 +24,8 @@ use C4::Context; use C4::Service; use C4::Log; use Koha::Token; +use CGI::Cookie; +use C4::Auth qw( get_session ); =head1 NAME @@ -135,6 +137,16 @@ sub set_preferences { C4::Service->return_success($response); } +my %cookies = CGI::Cookie->fetch; + +if ( exists $cookies{'CGISESSID'} ) { + my $sessionID = $cookies{'CGISESSID'}->value; + if ($sessionID) { + my $session = get_session($sessionID); + C4::Context->interface( $session->param('interface') ) if ($session); + } +} + C4::Service->dispatch( [ 'POST /([A-Za-z0-9_-]+)', ['value'], \&set_preference ], [ 'POST /', [], \&set_preferences ],