title: Get session from curl php
body: <p>I am having some trouble getting the actual session of the website, I need to use it later on with a reques.</p>
  
  <pre><code>$url="http://blabalbla";
  $postdata="pass:123";
  curl_setopt($handler, CURLOPT_URL, $url);
  curl_setopt($handler, CURLOPT_POST,true);
  curl_setopt($handler, CURLOPT_HEADER, 0);
  //Le vamos a enviar parámetros posts
  curl_setopt($handler, CURLOPT_POSTFIELDS, $postdata);
  curl_setopt($handler, CURLOPT_COOKIEJAR, 'cookie.txt');
  //Para poder guardar el html
  curl_setopt($handler, CURLOPT_RETURNTRANSFER, true);
  //Para seguir las redirecciones
  curl_setopt($handler, CURLOPT_FOLLOWLOCATION, true);
  
  $url_destino=curl_getinfo($handler, CURLINFO_EFFECTIVE_URL);
  //Executamos
  
  $response = curl_exec ($handler);
  </code></pre>
  
  <p>I can see that the session is saved in the cookie under PHPSESSID</p>