You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by ma...@ratp.fr on 2004/05/05 12:12:15 UTC

PerlTransHandler and 302 'Object Moved' response from web server

	Hi everyone,

I have searched through the archive but I haven't a solution to my problem.

I'm using a PerlTransHandler module to reverse proxy a website.

The website itself sets a cookie for tracking its 'own' session and my
module handles it without trouble (well, I think).

On some pages, the website sends a 302 'Object Moved' response and instead
of returning the 302 response to the web browser, Apache/my handler tries to
GET the new Location by itself, without setting the website's cookie. So,
the website losts its session and the user is sent back to the homepage.

My perlTransHandler uses a derivative work from the following code on the
mod_perl tricks page : 
http://perl.apache.org/docs/tutorials/tips/mod_perl_tricks/mod_perl_tricks.h
tml#A_Banner_Ad_Blocker
to handle the request generates by my reverse proxy and the response from
the Web site.

Thanks in advance for any help.

Sincerely yours, Mathieu MILLET.
PS : I have no control over the (reverse)proxied website.

--
Mathieu MILLET
mailto:mathieu.millet@ratp.fr
---- 

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: PerlTransHandler and 302 'Object Moved' response from web server

Posted by Perrin Harkins <pe...@elem.com>.
On Wed, 2004-05-05 at 06:12, mathieu.millet@ratp.fr wrote:
> On some pages, the website sends a 302 'Object Moved' response and instead
> of returning the 302 response to the web browser, Apache/my handler tries to
> GET the new Location by itself, without setting the website's cookie. So,
> the website losts its session and the user is sent back to the homepage.

It sounds like you know what you need to do: send the cookie on to the
other site.  Where are you getting stuck?  Is it just that you don't
know how to stop LWP from handling redirects automatically?  Check the
LWP::UserAgent man page for the simple_request() method.  You can also
give it cookies to send on every request.

- Perrin




-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html