cURL / Mailing Lists / curl-users / Single Mail

curl-users

curl 7.7.1 (win32) -b option doesn't send cookies!?

From: Serge Kruppa <serge_at_portaldevoz.net>
Date: Mon, 23 Apr 2001 06:39:45 +0100

Hello,

I have read through dozens of postings regarding the use of cookies with
curl but I'm still facing a problem with my attempt at logging onto Hotmail.
I'm using curl 7.7.1 (win32) libcurl 7.7.1 (SSL 0.9.6). I hope my question
is not too stupid and someone would be kind enough to help me.

Given the nature of the Hotmail login procedure I have to use two batch
files with distinct curl commands. The first batch file reads like:

curl -A "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)" -D
cookies -b -v -i -e lc3.law5.hotmail.passport.com -d "login=MYLOGIN
(etc)..." https://lc3.law5.hotmail.passport.com/cgi-bin/dologin -L

During the resulting login process Hotmail sends a lot of cookies that are
handled by curl and saved to the cookies file as expected. Finally a URL is
sent that must be opened using the second batch file which looks like:

curl -A "Opera/5.11 (Windows 2000; U) [en]" -v -i -b cookies -L
"http://lw15fd. (etc)..."

The problem is that according to my packet sniffer's trace, none of the
saved cookies are sent to the remote host that aborts the connection as a
result (with a "nocookies" redirect to the main login page).

I do not have any debugging facilities to check if the cookies file is
opened and read at all. It's content is similar to:

HTTP/1.1 100 Continue
Server: Microsoft-IIS/5.0
Date: Mon, 23 Apr 2001 04:57:42 GMT

HTTP/1.1 302 Redirected
Server: Microsoft-IIS/5.0
Date: Mon, 23 Apr 2001 04:57:42 GMT
Connection: close
Set-Cookie: MSPDom=2; expires=Wed, 30 Dec 2037 00:00:00 GMT;
domain=.passport.com; path=/
Set-Cookie:
MSPSec=2AAAAAAAAGeenHwsqnlz0dpOlh6EqsKfxzuHPHZwu9HhjhfRMV3n1dag%24%24;
domain=.passport.com; path=/ppsecure; secure
Set-Cookie:
MSPAuth=2AAAAAAAADrGmu1tu3ZYWNE%21lh6EqsKfxztLP3Y6a7hOKZi%2aNUOXyR%2aA%24%24
; domain=.passport.com; path=/
Set-Cookie:
MSPProf=2AAAAAAAAGc59voWBnQf%212FVH8IQKxLLdFSZnNs54SsXro2lsiPjNwnM5JTcuLqnry
xFR3jXfp8NZXkfE1HAqLK32QzCltMtlvvmbVuwPSUjwwddCFMMALJF7HRTdKk1JkNMrV0xxLZgv0
sL4wQdqYvSwIlmjTO4wXYacWjZNBXDw%24; domain=.passport.com; path=/

While the output from the packet sniffer shows that curl is trying to access
the correct URL but is not supplying the cookies as it should:

GET /cgi-bin/sbox?curmbox= (etc)... HTTP/1.1
User-Agent: Opera/5.11 (Windows 2000; U) [en]
Host: lw15fd.law15.hotmail.msn.com
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*

Am I making a silly mistake or is there really a problem in curl? Besides
that I have noticed that shuffling around the -b and -A arguments sometimes
(quite frequently) causes curl to use one of the literal parameters as a
hostname and attempt a DNS resolution!

Otherwise curl is a great and most useful piece of software. Thanks in
advance for your help.

Best Regards,

Serge

serge_at_portaldevoz.net
Received on 2001-04-23