in reply to LWP fails where browser succeeds?

Your server is almost certainly objecting to this weird URL:

GET http://ap1492-dsr/../SetSessionVars.php?RoleId=102&HierarchyId=3

Note the superfluous ../. My copy of Apache returns HTTP 400 Bad Request responses for requests with a leading ../. I notice that the reason LWP is requesting this URL is that it receives an HTTP 302 Found response redirecting to it:

Location: ../SetSessionVars.php?RoleId=102&HierarchyId=3

Did you know that strictly speaking the Location header is supposed to contain an absolute URL, not a relative URI reference? Fixing the server to always provide correct absolute URLs in the Location header should solve the issue.

A workaround could be to set $URI::ABS_REMOTE_LEADING_DOTS to 1, because LWP uses the URI library to resolve relative URI references.

perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Replies are listed 'Best First'.
Re^2: LWP fails where browser succeeds?
by jcabraham (Novice) on Aug 01, 2012 at 16:38 UTC
    That was indeed the problem. Thanks for such a great catch!