title: Using cookie in curl call with PHP
body: <p>I need to fetch some data from external site. To do this I need to load a site that creates some cookie and gives a simple math calculation to generate new link. This part is easy:</p>
  
  <pre><code>$cr = curl_init($url);
  curl_setopt($cr, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($cr, CURLOPT_COOKIEJAR, 'cookie.txt');
  $html = curl_exec($cr);
  curl_close($cr);
  </code></pre>
  
  <p>After those calls I have cookies stored in cookie.txt:</p>
  
  <pre><code># Netscape HTTP Cookie File
  # http://curl.haxx.se/docs/http-cookies.html
  # This file was generated by libcurl! Edit at your own risk.
  
  domain   FALSE   /       FALSE   0       PHPSESSID       o89t753egbp9pq9084n38eg2m1
  </code></pre>
  
  <p>Now, the question is: how can I load this cookie to use it in my next call to some other site (in the same domain ofcourse)?</p>