cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Easy "POST" question but cannot figure it out!!

From: Ralph Mitchell <ralphmitchell_at_gmail.com>
Date: Fri, 16 Nov 2007 12:45:36 -0600

On Nov 16, 2007 12:03 PM, <jon_at_linertia.com> wrote:

> > On Nov 16, 2007 12:34 AM, <jon_at_linertia.com> wrote:
> >
> >>
> >> When I run the curl operation on the website of interest, i.e.
> >>
> >> curl -vc cookie "www.example.com"
> >>
> >> the verbose output http header gives me:
> >>
> >> Added cookie session=XXXX for domain example.net, path /, expire 0
> >> < Set-Cookie: session=XXXX path=/; domain=.example.net
> >> * Added cookie PHPSESSID=AAAA for domain www.example.net, path /,
> expire
> >> 0
> >> < Set-Cookie: PHPSESSID=AAAA; path=/
> >> * Replaced cookie session=YYYY for domain example.net, path /, expire 0
> >> <
> >> Set-Cookie: session=YYYY path=/; domain=.example.net
> >>
> >> Question: WHY is it replacing my cookie XXXX with YYYY? I need my
> >> cookie
> >> to be XXXX for logging in to work.
> >
> >
> > The Set-Cookie lines are all coming from the server. Curl is correctly
> > updating its cookie collection because the server is telling it to.
> >
> > Ralph Mitchell
> >
>
> Ralph,
>
> Yes, but in firefox, it's using cookie XXXX. That's why something is
> weird. When I try to login using firefox it's using cookie XXXX while
> curl is trying to use cookie YYYY, which is why it's not working
> correctly.

Understood. But if Firefox is doing something different to curl, it's
because Firefox is interpreting *something* in the page that makes it
behave differently. Curl doesn't attempt to process the web page at all, so
so any javascript, java applets, flash scripts, etc do *not* get executed by
curl.

Whenever I'm writing a new script, I start at the server's home page,
download it, save it, examine it, then go on to the next page. If any
javascript fiddles with form variables, I try to emulate that behaviour.

Are you starting from the home page and checking for scripts in the html??
Some "clever" sites use scripts to make sure cookies are enabled, so maybe
there's a script switching XXXY and YYYY.

Ralph Mitchell
Received on 2007-11-16