curl doesn't write cookies in the cookie file when
this situation happens :
two Set-Cookie fields defines identical cookies
in the same http header.
example :
<?php
$cookie_file_path
= 'C:/DOCUMENTROOT/test.txt';
$LOGINURL = "http://signin.ebay.fr/aw-
cgi/eBayISAPI.dll?SignIn";
$agent = "Mozilla/5.0 (Windows; U; Windows
NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1
(ax)";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$LOGINURL);
curl_setopt($ch, CURLOPT_USERAGENT,
$agent);
curl_setopt($ch, CURLOPT_COOKIEJAR,
$cookie_file_path);
curl_setopt($ch, CURLOPT_COOKIEFILE,
$cookie_file_path);
$result = curl_exec ($ch);
curl_close ($ch);
print $result;
?>
the http header looks like this :
HTTP/1.1 200 OK
Server: Microsoft-IIS/4.0
Date: Fri, 23 Apr 2004 16:11:34 GMT
IISExport: This web site was exported using IIS Export
v2.2
Content-Type: text/html
Set-Cookie: secure_ticket=n; path=/; domain=.ebay.fr;
secure
Set-Cookie: ebaysignin=; path=/; domain=.ebay.fr
Set-Cookie: secure_ticket_l2=n; path=/;
domain=.ebay.fr; secure
Set-Cookie: sru=X; path=/; domain=.ebay.fr;
expires=Fri, 01-Sep-1995 00:00:00 GMT
Set-Cookie:
s=AQAAAAEAAAASAAAAOwAAADZAiUC2epJAMXRlc3RDb29
raWUgJDIkTW96aWxsYS8kTlk0dEFlbG1JY3U0NHdxcjBuLzR
pLwDNzc3Ng; path=/; domain=.ebay.fr
Set-Cookie: sru=X; path=/; domain=.ebay.fr;
expires=Fri, 01-Sep-1995 00:00:00 GMT
Set-Cookie:
s=AQAAAAEAAAASAAAAOwAAADZAiUC2epJAMXRlc3RDb29
raWUgJDIkTW96aWxsYS8kTlk0dEFlbG1JY3U0NHdxcjBuLzR
pLwDNzc3Ng; path=/; domain=.ebay.fr
My configuration :
Apache 2.0.48 / PHP 4.3.4 / curl 7.11.1 win32
through mod-curl.
it writes the cookies properly in other normal situations.
I admit sending two identical cookies is a strange idea,
but i'm not responsible for ibč stupidity.
kapouer@netcourrier.com
Logged In: NO
Never mind,
the problem i have is that secure cookies are not saved
if nothing allows to be secure.
Sorry for annoying you.
kapouer@netcourrier.com
Logged In: YES
user_id=1110
No problems.
secure cookies are only meant to be sent over 'secure'
connections.