cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Redirect problem?

From: Phill Edwards <philledwards_at_gmail.com>
Date: Sat, 16 Dec 2006 22:19:39 +1100

> 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/

This solved it (someone else worked this out for me):

curl -s -k -b "`curl -s -k -D - -d 'name=987654&password=12345'
'http://www.freecall.net.au/main.php' | grep Set-Cookie | sed
's/Set-Cookie: //'`" 'https://www.freecall.net.au/member.php'

Not sure why but just glad it works.

Thanks for all your help along the way.
Received on 2006-12-16