develooper Front page | perl.libwww | Postings from March 2001

LWP UserAgent Cookie Problem - redirect to same URI (?)

Thread Next
March 16, 2001 10:10
LWP UserAgent Cookie Problem - redirect to same URI (?)
Message ID:

I posted a problem the other day, which I've been receiving some 
offline sugestions with (thanks again), related to logging into a cookies 
controlled site.

Here's my original append of the problem -

I've tried a couple of suggested ways around my problem from recent appends 
by folks with similar situations. I tried the "LWP::UserAgent::redirect_ok" sub 
suggested in a recent append but this didn't help.
Here's the append I took this suggestion from -

I've since scanned the mailing list archive and stumbled upon something that 
appears to state that LWP won't be able to handle my situation (?) - 

>There is one problem though.  Some servers send a redirect to the
>exact same URI that the first request was aimed at, together with some
>Set-Cookie headers.  $ua->request() will currently not follow such
>redirects, because it think this will be an infinite loop.
Here's where I found this append -

This sounds like the case I have. Initial cookies are received by my 
perl cgi, but when I send the POST with my login info, the header cookie values
that are returned are null and I'm returned the same login page from where I did 
the POST. My cookie file still contains the initial cookie data received.

I get HTTP 200 return codes on all requests. Nothing appears in the headers 
that would make me think I'm being re-directed but a suggested test (using 
LWP simple_request) proved I am being redirected, apparently to the same URI.

I've been banging my head against this for a week now. The assistance received
so far has been great !
Can anyone suggest an alternate solution to this problem ? 

I have header trace output for all responses I receive if that would be useful.

Thanks in advance,
Steve Borruso

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About