cURL / Mailing Lists / curl-library / Single Mail

curl-library

cookies handling differences between 7.11.2 and 7.12.0

From: <388uw7j02_at_sneakemail.com>
Date: Sat, 5 Jun 2004 09:13:12 +0200

It seems like the changes in lib/cookies.c between 7.11.2 and 7.12.0
had undesirable side effects. It looks like for some reason (some?)
cookies don't get sent in the latter case.

curl's debugging output (as well as the logs produced by a packet
sniffer) confirmed this buggy behaviour.

############ curl-7.11.2
############ The server receives the cookies and sends the page.
+ cat cookies-22422
# Netscape HTTP Cookie File
# http://www.netscape.com/newsref/std/cookie_spec.html
# This file was generated by libcurl! Edit at your own risk.

a.b.c FALSE /cgi-bin/xyz/ FALSE 0 hfaccount a
a.b.c FALSE /cgi-bin/xyz/ FALSE 0 hfcata accounts
a.b.c FALSE /cgi-bin/xyz/ FALSE 1086373122 hfuser
a.b.c FALSE /cgi-bin/xyz/ FALSE 0 hfsession z56
a.b.c FALSE /cgi-bin/xyz/ FALSE 0 hfserverid a
+ curl --verbose --trace /tmp/ilog22422 -i --cookie cookies-22422
  --cookie-jar cookies-22422 -o page2-22422.htm -d 'a=b&c=d'
  http://a.b.c/cgi-bin/xyz/xxx

HTTP/1.1 200 OK
Connection: close
Date: Fri, 04 Jun 2004 09:12:34 GMT
Content-Type: text/html
Server: Apache/1.3.27 (Unix)
Set-Cookie: hfaccount=a; path=/cgi-bin/xyz/
Set-Cookie: hfcata=accounts; path=/cgi-bin/xyz/
Set-Cookie: hfsession=z60; path=/cgi-bin/xyz/
Set-Cookie: hfserverid=a; path=/cgi-bin/xyz/

############ curl-7.12.0
############ The server never sees the cookies and sends us backs
############ to the login page.
+ cat cookies-22497
# Netscape HTTP Cookie File
# http://www.netscape.com/newsref/std/cookie_spec.html
# This file was generated by libcurl! Edit at your own risk.

a.b.c FALSE /cgi-bin/xyz/ FALSE 0 hfaccount a
a.b.c FALSE /cgi-bin/xyz/ FALSE 0 hfcata accounts
a.b.c FALSE /cgi-bin/xyz/ FALSE 1086373122 hfuser
a.b.c FALSE /cgi-bin/xyz/ FALSE 0 hfsession R77
a.b.c FALSE /cgi-bin/xyz/ FALSE 0 hfserverid a

+ curl --verbose --trace /tmp/ilog22497 -i --cookie cookies-22497
  --cookie-jar cookies-22497 -o page2-22497.htm -d 'a=b&c=d'
  http://a.b.c/cgi-bin/xyz/xxx

HTTP/1.1 302 Found
Connection: close
Date: Fri, 04 Jun 2004 09:12:36 GMT
Location: http://www.b.c/cgi-bin/xyz/login
Content-Type: text/html; charset=iso-8859-1
Server: Apache/1.3.27 (Unix)

Any clues?
Received on 2004-06-07