title: PHP CURL seems to be ignoring cookie jar/file
body: <p>I'm using this....</p>
  
  <pre><code>    function cURL($url, $header=NULL, $p=NULL)
      {
  
          $ch = curl_init();
  
          curl_setopt($ch, CURLOPT_HEADER, true);
          curl_setopt($ch, CURLOPT_NOBODY, true);
          curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
          curl_setopt($ch, CURLOPT_URL, $url);
          curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
          curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
          curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
          curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
          curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1");
          curl_setopt($ch, CURLOPT_COOKIEFILE, "/tmp/TestCookies");
  
  
          if ($p) {
              curl_setopt($ch, CURLOPT_POST, 1);
              curl_setopt($ch, CURLOPT_POSTFIELDS, $p);
          }
          $result = curl_exec($ch);
  
          if ($result) {
              return $result;
          } else {
              return curl_error($ch);
          }
          curl_close($ch);
      }
  </code></pre>
  
  <p>And I'm making a call like this...</p>
  
  <pre><code>        $Headers = array(
                  "Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*\/*;q=0.5",
                  "Accept-Language: en-gb,en;q=0.5",
                  "Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7");
  
  
          $a = $this-&gt;cURL("https://www.mysite.com/",$Headers, null);
  </code></pre>
  
  <p>I'd expect this to receive a cookie and write it to the file <code>/tmp/TestCookies</code>. </p>
  
  <p>The site definitely returns <code>Set-Cookie</code> headers - I can see them if I dump <code>$a</code>, however, the file in question is never created.</p>
  
  <p>In case it's a permissions issue, I created it with <code>touch</code> and <code>chmod 777</code>'d it - The file now exists but it's empty.</p>
  
  <p>What am I doing wrong?</p>