I'm doing some cURL work in php 5.3.0.
I'm wondering if there is any way to tell the curl handle/object to keep the cookies in memory (assuming I'm reusing the same handle for multiple requests), or to somehow return them and let me pass them back when making a new handle.
Theres this long accepted method for getting them in/out of the request:
curl_setopt($ch, CURLOPT_COOKIEJAR, $filename); curl_setopt($ch, CURLOPT_COOKIEFILE, $filename);
But I'm hitting some scenarios where I need to be running multiple copies of a script out of the same directory, and they step on each others cookie files. Yes, I know I could use tempnam() and make sure each run has its own cookie file, but that leads me to my 2nd issue.
There is also the issue of having these cookie files on the disk at all. Disk I/O is slow and a bottle neck I'm sure. I dont want to have to deal with cleaning up the cookie file when the script is finished (if it even exits in a way that lets me clean it up).
Any ideas? Or is this just the way things are?