You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by im...@grieg.esiea-ouest.fr on 2002/08/22 10:38:34 UTC
Why the content of a main request can't be accessed in a subrequest ?
I try to make an Authentification system.
I have a PerlAuthenHandler : Authen.pm
And I have a PerlHandler : Login.pm
In Login.pm, after the login and password checking, I have to redirect the
user to his original request.
So if this original request was a POST Request, I have to access
the content.
I'm in a subrequest (because of an internal_redirect) and I try to access
the content of my POST main request like this:
my $prev = $r->prev;
my $content = $prev->content;
I look at the result like this :
print STDERR $content;
but $content is undef !
Then I have try another solution: (also in Login.pm)
my $prev = $r->prev;
my $aprPrev = Apache::Request->instance($prev);
my $content = $aprPrev->param;
but $content is also undef !
It is normal because $aprPrev->param use $prev->content, but when i put this
two following lines in my Authen.pm (PerlAuthenHandler)
my $apr = Apache::Request->instance($r);
$apr->param;
it work, I can access the content in my Login.pm like this:
my $prev = $r->prev;
my $aprPrev = Apache::Request->instance($prev);
my $content = $aprPrev->param;
So Why the content of a main request can't be accessed in a subrequest ?
And Why i should instance an Apache::Request in the main request,
if I want to acces the content of the main in the subrequest?