php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27616 Using Objects with Constructors/Destructors - Filesystem Delete Issues
Submitted: 2004-03-16 19:08 UTC Modified: 2004-08-03 09:18 UTC
From: nathan@php.net Assigned:
Status: Not a bug Package: cURL related
PHP Version: 5CVS-2004-03-16 (dev) OS: Linux 2.4.22
Private report: No CVE-ID: None
 [2004-03-16 19:08 UTC] nathan@php.net
Description:
------------
When you create more than one Cookie Jar file using cURL, and using an object with a constructor and destructor to create/delete the temporary file, only one of the two cookie jar files is deleted, even though the destructor reports that deletion of both was successful.

If you find any website that requires you to login, you should be able to reproduce this.

Personally, I think there needs to be an option to use PHP writable streams for the COOKIEJAR/COOKIEFILE cURL Options, to allow more freedom to store the data. I would hope that would allow you to store the cookies in memory while the page executes, and have them cleared from memory once the request has completed successfully.

Reproduce code:
---------------
http://www.nightsys.net/cookiebugs/

This URL has all the source code required.

Expected result:
----------------
Both Cookie Jars to be deleted.

Actual result:
--------------
Only one of the two cookie jars are deleted. If you tell it to just unset one of the two objects, and only make 2 of the 3 cURL requests, the jar is removed. It only seems to be an issue when two are unset one after the other.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-03-29 17:34 UTC] daniel at haxx dot se
Unfortunately, libcurl doesn't provide a rich enough API for the COOKIEJAR/COOKIEFILE to get stored in memory or similar. That is still in the TODO for the library. Until that happens, getting the jar written to a file is the only supported way.
 [2004-03-30 02:23 UTC] derick@php.net
We have to mark it as "bogus" then, meaning that it is not really a problem in PHP.
 [2004-08-03 05:51 UTC] nathan@php.net
The factor of not being able to use streams for COOKIEJAR/FILE storage is fair enough. But the bug still exists using standard files for Cookie Jar's. Check the report, and test if you like. I have just tested this using PHP 5.0.0 and the issue still exists.
 [2004-08-03 08:58 UTC] helly@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip
 [2004-08-03 09:18 UTC] derick@php.net
Read the reason that Daniel gave you. Bogus
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 11:01:21 2019 UTC