title: Get Request Cookie from website with Curl in PHP
body: <p>I want to get the Request Cookie from a website using the curl method in PHP. Is this possible or not? I tried with curl but it just gets a Response Cookie and I don't know how request cookie works. Can someone help me?</p>
  
  <p>Example code:</p>
  
  <pre><code>&lt;?php
  $url = "https://www.ebay.com/";
  
  $ch = curl_init();
  
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  curl_setopt($ch, CURLOPT_HEADER, 1);
  curl_setopt($ch, CURLINFO_HEADER_OUT, true);
  
  $response = curl_exec($ch);
  
  
    $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
    $headers = substr($response, 0, $header_size);
    $body = substr($response, $header_size);
  
  curl_close($ch);
  
  
  print($headers)
  ?&gt;
  
  </code></pre>
  
  <p>I want to get request cookie based on screenshot:</p>
  
  <p><a href="https://i.stack.imgur.com/wpqjf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wpqjf.png" alt="screenshot"></a></p>