Loading a cookie and posting data with curl <p>If I load in a cookie, I am able to get to the page that requires cookies, like this:</p> <pre><code>$cookie = ".ASPXAUTH=Secret"; curl_setopt($ch, CURLOPT_COOKIE, $cookie); </code></pre> <p>No problem here, I can run <code>curl_exec</code>, and see the page that requires cookies. </p> <p>If I also want to send some post data, I can do like this:</p> <pre><code>$data = array( 'index' =&gt; "Some data is here" ); $cookie = ".ASPXAUTH=Secret"; curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_COOKIE, $cookie); </code></pre> <p>I have set up a <a href="http://pastebin.com/37mDNNHr" rel="nofollow">dump script</a> on my local server, to see if it is working. If i send <strong>only</strong> the cookie, I can see it in the http headers, and if I send <strong>only</strong> the post data, I can see the post data.</p> <p>When I send both, I see only the cookie. </p> <p>Why?</p>