title: CURL get external page cookies and use them in my page
body: <p>am trying to get all cookies from external page and set them in my page, i have this script:</p>
  
  <pre><code> $url = "http://www.booking.com/hotel/cz/red-blue-design-prague.html?checkin=2012-07-07&amp;interval=1&amp;selected_currency=USD";
   $ckfile = tempnam ("tmp", "CURLCOOKIE");
  
   $options = array(
      CURLOPT_RETURNTRANSFER =&gt; TRUE,     // return web page
      CURLOPT_HEADER         =&gt; TRUE,     // do not return headers
      CURLOPT_HEADER         =&gt; TRUE,     // do not return headers
      CURLOPT_FOLLOWLOCATION =&gt; TRUE,     // follow redirects
      CURLOPT_USERAGENT      =&gt; "googlebot", // who am i
      CURLOPT_AUTOREFERER    =&gt; TRUE,     // set referer on redirect
      CURLOPT_CONNECTTIMEOUT =&gt; 120,        // timeout on connect
      CURLOPT_TIMEOUT        =&gt; 120,        // timeout on response
      CURLOPT_MAXREDIRS      =&gt; 3,        // stop after 10 redirects
      CURLOPT_ENCODING       =&gt; 'UTF-8',
      CURLOPT_COOKIEJAR      =&gt; $ckfile,
      CURLOPT_COOKIEFILE     =&gt; $ckfile
    );
    $ch = curl_init();
    curl_setopt_array( $ch, $options );
    curl_setopt($ch, CURLOPT_URL, $url);
    $a = curl_exec($ch);
  </code></pre>
  
  <p>but it's not getting cookies when i check <code>$ckfile</code>, can someone help, thanks</p>