"Sean M. Burke" <[EMAIL PROTECTED]> writes: > I've run into a weird situation with LWP::UserAgent. Here's what I'm doing: > > I have this cookie that is a session ID, and it's not expired yet, but > after a while the server thinks it's not "good" anymore. So when I try > requesting URL A, the server decides that it needs to vend me a new session > ID cookie. It redirects to URL B, which is a program that simply vends me > a new sesson ID and then simply redirects me back to URL A. Ah, but > LWP::UserAgent considers that a loop, since it triggers the test > $r->request->url->as_string eq $referral_uri->as_string which blocks > redirection. > > I think I've figured out a way to fix this. It involves testing > $r->request->url->as_string eq $referral_uri->as_string, but then NOT > actually rejecting this request if there's a cookie jar and if the cookie > jar seems to have changed between now and then (unless $count hits 13, in > which case we definitely give up). Should I code this up and submit it as > a patch? The site that's giving me trouble is none other than the New York > Times -- which besides being big and important, is also going to be the > cookies example in my book, so it sort of Has To Work for several reasons. > What do you think?
Feels like too much special casing of cookies to me. How about if we simply remove the $r->request->url->as_string eq $referral_uri->as_string test and only have a counter to protect us agains infinite loops. We might want to make 13 configurable :) --Gisle
