cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: newb question: cookies w/ post

From: Dennis Falling <dfalling_at_mac.com>
Date: Mon, 14 Feb 2005 12:48:34 -0600

What do you mean that I don't follow locations? The primary login
page is <https://my.netspace.net.au/>, but I'm using the page that it
redirects the post to <https://my.netspace.net.au/logincheck> to send
the info to.

As far as the cookies, do I need to access the first page to get the
cookie, then when accessing the second page with the login info, use
that cookie?

Thanks,
-dennis

On Feb 14, 2005, at 4:29 AM, Daniel Stenberg wrote:

> On Mon, 14 Feb 2005, Dennis Falling wrote:
>
>> I'm trying to use curl to post to a page, but the page tells me I
>> don't have cookies enabled. I've tinkered around with the different
>> settings, but haven't gotten anything to work. Does anyone know the
>> best way to make this work? Here's the command I'm using...the
>> resulting page complains about cookies. Ideally, it will complain
>> about a bad username/password...
>>
>> curl -b cookies.txt -d
>> "username=elroyel1327&password=woo&Next=Submit"
>> https://my.netspace.net.au/logincheck
>
> As always, figure out what your browser does.
>
> I see you don't follow locations. Most login scripts that accept
> logins with a POST send you to another location (and set a cookie)
> after a successful login.
>
> Sometimes you are even expected to have a cookie when you submit the
> first POST, since the site passes them to the client when browsing the
> login page. Then you need to adapt to that.
>
> --
> Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
> Dedicated custom curl help for hire: http://haxx.se/curl.html
>
Received on 2005-02-14