in reply to LWP form post example not working
You mention that it uses sessions. Does that mean it's setting a cookie? Your script, as written, will not accept cookies (or rather, forgets them as soon as it receives them).
If I were a login page, on successful POST I might respond with a cookie-setting redirect, then the protected page would check for the cookie, and if it's missing, redirect to the login page. You'd then see exactly the behavior you see above.
You could check for that by installing something like LiveHTTPHeaders for Firefox, or something similar - anything that lets you view the HTTP requests and responses. Then disable cookies and try to log in.
To enable your script to accept cookies, see the cookie_jar method in LWP::UserAgent, or just do this:
Good luck! --Clinton# Instead of $ua = LWP::UserAgent->new(); $ua = LWP::UserAgent->new(cookie_jar => {});
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: LWP form post example not working
by perlchild (Acolyte) on Oct 14, 2008 at 14:46 UTC |