php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26853 cookiejar broken
Submitted: 2004-01-09 10:16 UTC Modified: 2004-01-14 09:59 UTC
From: nytral at spamcop dot net Assigned: edink (profile)
Status: Closed Package: cURL related
PHP Version: 5CVS-2004-01-09 (dev) OS: win32 and linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: nytral at spamcop dot net
New email:
PHP Version: OS:

 

 [2004-01-09 10:16 UTC] nytral at spamcop dot net
Description:
------------
Since php_curl is linked against libcurl 7.10.5+, cookies are not being stored for an https server I'm talking to. If it is because of
Cache-Control: no-cache="set-cookie,set-cookie2"
sent by the server, is there a workaround to force the cookiejar to populate anyway?


Reproduce code:
---------------
	$ch = curl_init();

	curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);

	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);

	curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0);

	curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);

	curl_setopt($ch, CURLOPT_COOKIEFILE, "/tmp/cookies");

	curl_setopt($ch, CURLOPT_COOKIEJAR, "/tmp/cookies");

	curl_setopt($ch, CURLOPT_SSLVERSION, 3);

	curl_setopt($ch, CURLOPT_URL,$url);

	$buf=curl_exec($ch);

Expected result:
----------------
To get something in /tmp/cookies when the server returns cookies, as it's the case with PHP < 4.3

Actual result:
--------------
No /tmp/cookie file gets created.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-01-11 19:20 UTC] sniper@php.net
Can not reprduce. (works fine with e.g. http://www.php.net/)

 [2004-01-12 10:22 UTC] nytral at spamcop dot net
I found the issue, it is with the domain= part of the Set-Cookie header. As soon as you put something in it which is not the FQDN of the remote host, the cookie won't be stored, even if it's valid, i.e
Set-Cookie: test=test; domain=php.net; path=/
I see in curl changelog for 7.10.7:
"cookie parser now only requires two dots in cookie domain"
Can you build something on win32 linked with a more recent curl version to see if it helps?
thanks.
 [2004-01-12 10:23 UTC] nytral at spamcop dot net
Forgot to change the status back to open.
 [2004-01-13 14:39 UTC] sniper@php.net
Edin, can you look into this? (win32 needs latest CURL?)
(same propably goes for PHP 4 too?)

 [2004-01-14 09:59 UTC] edink@php.net
Windows builds will from now on bundle libcurl-7.10.8.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 05:01:31 2024 UTC