Force remove pdata cookie to avoid loop (#1878)

This commit is contained in:
Christophe Maudoux 2019-08-12 21:29:08 +02:00
parent c928189779
commit d7cb8bf4b8

View File

@ -55,6 +55,20 @@ sub handler {
}
my $res = $self->Lemonldap::NG::Common::PSGI::Router::handler($req);
# Avoid permanent loop 'Portal <-> _url' if pdata cookie is not removed
my $url64 = encode_base64( $req->userData->{_url}, '' );
if ( $url64
and !$req->pdata->{keepPdata}
and $req->userData->{_session_id}
and ( $req->{env}->{HTTP_COOKIE} =~ /$url64/ ) )
{
$self->logger->debug("Force cleaning pdata");
$self->logger->warning("pdata cookie domain must be set")
unless ( $self->conf->{pdataDomain} );
$req->pdata( {} );
}
# Save pdata
if ( $sp or %{ $req->pdata } ) {
my %v = (