cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: newb question: cookies w/ post

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Mon, 14 Feb 2005 11:29:07 +0100 (CET)

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