title: How to read COOKIES from text file PHP
body: <p>I have used CURL with PHP, please check the below code</p>
  
  <pre><code>$cookie = "cookies.txt";
  file_put_contents($cookie, "");
  $ch = curl_init();
  
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
  curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
  curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  $response = curl_exec($ch);
  </code></pre>
  
  <p>After that I opened the <code>cookies.txt</code> file, in that the cookies are stored.</p>
  
  <p>Now how do I read that file to get required content.</p>
  
  <p>I have tried to read the file using <code>readfile</code> <code>file_get_contents</code> but no use at all, these are just returning empty string.</p>
  
  <p>Please help me out. </p>
  
  <p>Thanks in advance</p>