#33475 [Ver->Csd]: CURLOPT_COOKIEJAR dosen't work in php5
| From: | iliaa@php.net | Date: | Sun, 26 Jun 2005 17:31:12 +0000 |
| Subject: | #33475 [Ver->Csd]: CURLOPT_COOKIEJAR dosen't work in php5 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-81040@lists.php.net to get a copy of this message | ||
ID: 33475
Updated by: iliaa@php.net
Reported By: edman007x at mac dot com
-Status: Verified
+Status: Closed
Bug Type: cURL related
Operating System: Linux
PHP Version: 5.1b2
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2005-06-26 13:32:54] sniper@php.net
Add 'unset($ch);' after the 'curl_close($ch);' call and it will work.
------------------------------------------------------------------------
[2005-06-26 01:49:37] edman007x at mac dot com
i upgraded the server to 5.1b2 and it still didn't work
------------------------------------------------------------------------
[2005-06-25 22:21:44] edman007x at mac dot com
Description:
------------
in my php 5.0.3 and php 5.0.4 servers curl did not write
to the cookieJar file even though it is writable and
there are cookies that were received
phpinfo for working server is @ http://
edman007.optikhosting.com/phpinfo.php
phpinfo for php server that doesn't work is @ http://
server.antiwindows.gotdns.com/phpinfo.php
Reproduce code:
---------------
<?php
header('Content-type: text/plain');
$file = tempnam('/tmp', 'php_bug_test');//should be writable
//a check
echo is_writable($file)?'This File Is Writable':'This File Is not
Writable';
echo "\n";
//and again
echo system('ls -lah '.$file);
echo "\n";
$ch = curl_init('http://www.yahoo.com/');///this
site will give me a
cookie
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, $file);
curl_exec($ch);
curl_close($ch);
echo file_get_contents($file);
unlink($file);
?>
Expected result:
----------------
(i got this from a php 4.3.11 server)
This File Is Writable
-rw------- 1 nobody nobody 0 Jun 25 15:15
/tmp/php_bug_testKzXWcK
-rw------- 1 nobody nobody 0 Jun 25 15:15
/tmp/php_bug_testKzXWcK
# Netscape HTTP Cookie File
# http://www.netscape.com/newsref/std/cookie_spec.html
# This file was generated by libcurl! Edit at your own
risk.
.www.yahoo.com TRUE / FALSE 1149188400 FPB
311up3uh111brer0
Actual result:
--------------
(i got this from my php 5.0.4 server)
This File Is Writable
-rw------- 1 nobody nobody 0 2005-06-25 16:15 /tmp/
php_bug_testYspF2w
-rw------- 1 nobody nobody 0 2005-06-25 16:15 /tmp/
php_bug_testYspF2w
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33475&edit=1