php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33475 CURLOPT_COOKIEJAR dosen't work in php5
Submitted: 2005-06-25 22:21 UTC Modified: 2005-06-26 19:31 UTC
From: edman007x at mac dot com Assigned:
Status: Closed Package: cURL related
PHP Version: 5.1b2 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: edman007x at mac dot com
New email:
PHP Version: OS:

 

 [2005-06-25 22:21 UTC] 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


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-06-26 01:49 UTC] edman007x at mac dot com
i upgraded the server to 5.1b2 and it still didn't work
 [2005-06-26 13:32 UTC] sniper@php.net
Add 'unset($ch);' after the 'curl_close($ch);' call and it will work. 
 [2005-06-26 19:31 UTC] iliaa@php.net
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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 13:01:29 2024 UTC