cURL / Mailing Lists / curl-users / Single Mail

curl-users

Cookie ignored !(?)

From: Jan Sundin <jan_at_sundin.com>
Date: Mon, 4 Aug 2003 18:38:08 +0200

Hi all,
Im having trouble with cookies in Curl (version curl-7.10.6, win32,
openssl-0.9.7a ).

For the URL im requesting the server sets two cookies and sends a
redirect/location-header. Curl then issues a GET to the correct URL but does
_not_ set any cookie-headers to send the cookies back to the server! Why
isn't the cookies sent back to the server?

My command line:
curl -c cookies.out -b cookies.in -k --trace-ascii out.txt -i -L -v
https://test.NOT_DISCLOSED.se/ICSLogin/auth-up -d paramA -d paramB

(Note that the cookie-engine is enabled with -b). After executing the
command the file cookies.out is empty. Below is a trace from the session.

Why is the cookie "ignored" by curl?

TIA

Jan

== Info: About to connect() to test.NOT_DISCLOSED.se:443
== Info: Connected to test.NOT_DISCLOSED.se (XXX.XXX.XXX.XXX) port 443
== Info: SSL connection using DES-CBC3-SHA
== Info: Server certificate:
== Info: subject: /C=SE/O=NOT_DISCLOSED/OU=AddTrust TTP
Network/CN=*.NOT_DISCLOSED.se
== Info: start date: 2002-12-10 21:47:55 GMT
== Info: expire date: 2004-01-21 21:47:55 GMT
== Info: common name: *.NOT_DISCLOSED.se (matched)
== Info: issuer: /C=SE/O=PKI Partner AB/CN=AddTrust2Server CA 07
=> Send header, 361 bytes (0x169)
0000: POST /ICSLogin/auth-up HTTP/1.1
0021: User-Agent: curl/7.10.6 (win32) libcurl/7.10.6 OpenSSL/0.9.7a zl
0061: ib/1.1.4
006b: Host: test.NOT_DISCLOSED.se
007e: Pragma: no-cache
0090: Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
00d2: Content-Length: 80
00e6: Content-Type: application/x-www-form-urlencoded
0117:
0119: paramA&paramB (modified)
<= Recv header, 20 bytes (0x14)
0000: HTTP/1.1 302 Found
<= Recv header, 45 bytes (0x2d)
0000: Content-Type: text/html; charset=ISO-8859-1
<= Recv header, 22 bytes (0x16)
0000: Content-Length: 1472
<= Recv header, 18 bytes (0x12)
0000: Pragma: no-cache
<= Recv header, 88 bytes (0x58)
0000: Location:
https://test.NOT_DISCLOSED.se:443/ICSIBroker/?"https://test.NOT_DISCLOSED.
0040: se/m2m/rgk/test.xml"-T
<= Recv header, 79 bytes (0x4f)
0000: Set-Cookie: IPCZQX01af0fca5c=000010008168c200d25dfc4b; path=/; d
0040: omain=.NOT_DISCLOSED.se
<= Recv header, 93 bytes (0x5d)
0000: Set-Cookie: IPCXAFS-NOT_DISCLOSED.se=0; expires=Thu, 01-Jan-1970
00:00:00
0040: GMT; path=/; domain=.NOT_DISCLOSED.se
== Info: Ignoring the response-body
<= Recv data, 1472 bytes (0x5c0)
0000: <html>

.. HTML-page removed..

05b7: </html>

== Info: Connection #0 left intact
== Info: Issue another request to this URL:
'https://test.NOT_DISCLOSED.se:443/ICSIBroker/?"https://test.NOT_DISCLOSED.s
e/m2m/rgk/test.xml"-T'
== Info: Disables POST, goes with GET
== Info: Re-using existing connection! (#0)
== Info: Connected to (XXX.XXX.XXX.XXX) port 443
=> Send header, 247 bytes (0xf7)
0000: GET /ICSIBroker/?"https://test.NOT_DISCLOSED.se/m2m/rgk/test.xml"-T
HTTP/1
0040: .1
0044: User-Agent: curl/7.10.6 (win32) libcurl/7.10.6 OpenSSL/0.9.7a zl
0084: ib/1.1.4
008e: Host: test.NOT_DISCLOSED.se
00a1: Pragma: no-cache
00b3: Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
00f5:
<===== Here curl should add a Cookie:-header
<= Recv header, 24 bytes (0x18)
0000: HTTP/1.1 403 Forbidden
<= Recv header, 45 bytes (0x2d)
0000: Content-Type: text/html; charset=ISO-8859-1
<= Recv header, 22 bytes (0x16)
0000: Content-Length: 1393
<= Recv header, 18 bytes (0x12)
0000: Pragma: no-cache
<= Recv header, 19 bytes (0x13)
0000: Connection: close
<= Recv data, 1393 bytes (0x571)
0000: <html>

.. HTML-page removed..

0568: </html>
== Info: Closing connection #0

-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
Received on 2003-08-04