title: Curl does not write to cookies.txt?
body: <p>I am trying to write a Cookie after login to cookies.txt.</p>
  
  <p>My source code: </p>
  
  <p><code>
      $ch = curl_init();
      curl_setopt($ch, CURLOPT_URL, $loginUrl);
      curl_setopt($ch, CURLOPT_POST, 1);
      curl_setopt($ch, CURLOPT_POSTFIELDS,
      'loginMail='.$username.'&amp;password='.$password.'&amp;targetUrl=');
      curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookies.txt'); 
      curl_setopt ($ch, CURLOPT_COOKIEFILE, 'cookies.txt'); 
      curl_setopt($ch, CURLOPT_USERAGENT, $agent);
      curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
      $store = curl_exec($ch);
      curl_close($ch);</code></p>
  
  <p>The output of the store variable shows that login was successful. But there is no change in the cookies.txt. Rights are set to 777. After login there is a redirect on the page.</p>
  
  <p>What might be the reason for it?</p>