title: Any way to keep curl's cookies in memory and not on disk
body: <p>I'm doing some cURL work in php 5.3.0.</p>
  
  <p>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.</p>
  
  <p>Theres this long accepted method for getting them in/out of the request:</p>
  
  <pre><code>curl_setopt($ch, CURLOPT_COOKIEJAR, $filename); 
  curl_setopt($ch, CURLOPT_COOKIEFILE, $filename);
  </code></pre>
  
  <p>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.</p>
  
  <p>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).</p>
  
  <p>Any ideas? Or is this just the way things are?</p>