cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Redirect problem?

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Fri, 15 Dec 2006 08:25:33 -0800

On Fri, Dec 15, 2006 at 09:02:52PM +1100, Phill Edwards wrote:
> The one line curl commands people recommended don't end up on the
> members.php page (I can tell because of the <TITLE> tag). The only way
> I've got as far as members.php is to use my horrible-looking double
> curl command. But when I do get this far the info I'm after is not
> populated, almost as if the username and password have failed
> validation.
>
> Here's what I get in LiveHTTPHeaders in Firefox:
>
> --------------------------------------------------------------------------------------------------
> http://www.freecall.net.au/main.php
>
> POST /main.php HTTP/1.1
> Host: www.freecall.net.au
> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
> rv:1.8.0.8) Gecko/20061025 Firefox/1.5.0.8
> Accept:
> text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
> Accept-Language: en-us,en;q=0.5
> Accept-Encoding: gzip,deflate
> Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
> Keep-Alive: 300
> Connection: keep-alive
> Referer: http://www.freecall.net.au/main.php
> Cookie: PHPSESSID=2bdc719989db278626606131200138cb
> Content-Type: application/x-www-form-urlencoded
> Content-Length: 35
> name=987654&password=12345&x=27&y=7

What stood out for me here was that the initial POST sent a cookie. The
subsequent redirect and load of the member.php page also sent the same
cookie. It's quite likely that the login process attaches your login
credentials to that cookie, and it's lack during that processes is what's
causing the failure you're seeing. Try getting a cookie before going to
that page; it's probably as simple as:

 curl -c cookie http://www.freecall.net.au/

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2006-12-15