cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Used -c, but Google says curl doesn't accept cookies

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 12 Sep 2011 10:39:14 +0200 (CEST)

On Sun, 11 Sep 2011, Jerry Krinock wrote:

> curl -v -c /Users/jk/Desktop/cookies.txt -d
> 'Email=jerry%40ieee.org&Passwd=**********&PersistentCookie=yes&GALX=Xa7ppOe4k9M&3sh=-86451143036426461702&secTok=&timeStmp='
> https://www.google.com/accounts/ServiceLoginAuth
>
> Upon sending this, I get some cookies from Google written to the designated
> cookie jar. However, in the response data, HTML, Google tells me that "Your
> browser's cookie functionality is turned off. Please turn it on."

That often happens because the server assumes that when you POST something,
you do that from a page with a <form> and that page (or another one) already
set a cookie that your request doesn't contain.

This is often fixed by you first retrieving the <form> page and storing the
cookies from that, and then you do the POST.

All this and more will be revealed if you track what your browser does, using
a plugin like LiveHTTPHeaders or similar.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2011-09-12