title: How to make post request within php session?
body: <p>Cannot make post request within session, can someone help?i copy from previously stack answers all of this), my php version is 7.3.11, when i launch this php and he just become blank and all, no any errors!</p>
  
  <pre><code>&lt;?php
  define("COOKIE_FILE", "cookie.txt");
  session_start();
  
  
  ini_set('display_errors', 1);
  ini_set('display_startup_errors', 1);
  ini_set('error_reporting', E_ALL);
  
  
  function httpPost($url, $data)
  {
      $curl = curl_init($url);
      curl_setopt($curl, CURLOPT_POST, true);
      curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      curl_setopt($curl, CURLOPT_COOKIESESSION, true);
      curl_setopt($curl, CURLOPT_URL, $url);
      curl_setopt($curl, CURLOPT_USERAGENT,'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:70.0) Gecko/20100101 Firefox/70.0');
      curl_setopt($curl, CURLOPT_COOKIEJAR, COOKIE_FILE); 
      curl_setopt($curl, CURLOPT_COOKIEFILE, COOKIE_FILE); 
      $response = curl_exec($curl);
      curl_close($curl);
      return $response;
  }
  
  httpPost('myurl', array('ss'=&gt;'ss'));
  </code></pre>