cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: posting with curl

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Wed, 9 May 2007 10:41:43 -0700

On Wed, May 09, 2007 at 08:49:45AM +0100, sonali gadekar wrote:
> I matched the headers and cookies with browser and they are exactly matching.

"Exactly"? The command-line you give below won't produce exactly the same
headers as a browser would (e.g. User-Agent & Accept will be different).

> And after executing curl the cookies get saved correctly which means that login
> is successful, but when I am trying to log in to another page using same
> cookies.. its failing.
>
> How can I make sure that cookies are valid or where I am going wrong.

Please be more specific. Is the new page on the same or a different host?
What command line are you using?

> Daniel Stenberg <daniel_at_haxx.se> wrote:
>
> On Tue, 8 May 2007, sonali gadekar wrote:
>
> > curl --cookie cookies --cookie-jar cookies --location
> > https://rhn.redhat.com/rhn/YourRhn.do --data
> > "username=user&password=password&_flowId=legacy-login-flow&
> _eventId_submit=Log+In"
> > https://www.redhat.com/wapps/sso/rhn/login.html
>
> --location doesn't take any extra arguments. This command line thus
> features
> two URLs to which curl will POST to, and I doubt you intended that.
>
> --trace-ascii and LiveHTTPHeaders are two good tools to use as well.

>>> Dan

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