diff --git a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/AuthBasic.pm b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/AuthBasic.pm index 88b16cc32..35f6b61d3 100644 --- a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/AuthBasic.pm +++ b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/AuthBasic.pm @@ -144,16 +144,16 @@ sub run ($$) { $class->updateStatus( $datas->{$whatToTrace}, $apacheRequest->uri, 'OK' ); $class->logGranted( $uri, $datas ); - # ACCOUNTING - # 2 - Inform remote application - $class->sendHeaders; - # SECURITY # Hide Lemonldap::NG cookie $class->hideCookie; # Hide user password - $class->lmSetHeaderIn( $apacheRequest, Authorization => '' ); + $class->lmUnsetHeaderIn( $apacheRequest, "Authorization"); + + # ACCOUNTING + # 2 - Inform remote application + $class->sendHeaders; OK; } diff --git a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Simple.pm b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Simple.pm index ddafa8506..7e9e3435d 100644 --- a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Simple.pm +++ b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Simple.pm @@ -32,7 +32,7 @@ use constant MAINTENANCE_CODE => 503; #inherits Apache::Session #link Lemonldap::NG::Common::Apache::Session::SOAP protected globalStorage -our $VERSION = '1.2.2'; +our $VERSION = '1.2.3'; our %EXPORT_TAGS; @@ -826,8 +826,12 @@ sub hideCookie { my $class = shift; $class->lmLog( "removing cookie", 'debug' ); my $tmp = lmHeaderIn( $apacheRequest, 'Cookie' ); - $tmp =~ s/$cookieName(?:http)?[^,;]*[,;]?//og; - $class->lmSetHeaderIn( $apacheRequest, 'Cookie' => $tmp ); + $tmp =~ s/$cookieName(http)?=[^,;]*[,;\s]*//og; + if ($tmp) { + $class->lmSetHeaderIn( $apacheRequest, 'Cookie' => $tmp ); + } else { + $class->lmUnsetHeaderIn( $apacheRequest, 'Cookie' ); + } } ## @rmethod protected string encodeUrl(string url)