title: php curl GET request with cookies
body: <p>I am using the below code to initiate a GET request but I get only &quot;status&quot;:403 from the JSON. The JSON needs a cookie to access. So I added the cookie. What mistake am I making here? Why do I get 403 status and can't access JSON?</p>
  <pre><code>$url = &quot;URL HERE&quot;;
  
  $curl = curl_init($url);
  curl_setopt($curl, CURLOPT_URL, $url);
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  
  $headers = array(
     &quot;Cookie: ci_session=COOKIE HERE&quot;,
     &quot;Accept: application/json&quot;,
  );
  curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
  //for debug only!
  curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
  curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
  
  $resp = curl_exec($curl);
  curl_close($curl);
  var_dump($resp);
  </code></pre>