|  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: 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
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.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2004-03-16 19:08 UTC]
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:

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.


Add a Patch

Pull Requests

Add a Pull Request


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]
We have to mark it as "bogus" then, meaning that it is not really a problem in PHP.
 [2004-08-03 05:51 UTC]
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]
Please try using this CVS snapshot:
For Windows:
 [2004-08-03 09:18 UTC]
Read the reason that Daniel gave you. Bogus
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jul 24 22:01:28 2024 UTC