cURL cookie value [closed] cURL cookie value [closed] curl curl

cURL cookie value [closed]


You should use CURLOPT_COOKIE not CURLOPT_HTTPHEADER to set the cookie values sent in the request.

curl_setopt($ch, CURLOPT_COOKIE, "loopermanlooperman=$sessid")

CURLOPT_COOKIE

The contents of the "Cookie: " header to be used in the HTTP request. Note that multiple cookies are separated with a semicolon followed by a space (e.g., "fruit=apple; colour=red")

http://www.php.net/manual/en/function.curl-setopt.php/

It does make CURL send the cookie. Try requesting a script that outputs the contents of the headers like this;

<?phpecho "Your cookies \n";print_r( $_COOKIE);?>

It might be the site is checking the referral or host in your header. You can always try looking at the requests made in a browser (in chrome go Spanner -> Tools -> Developer Tool -> Network, now request the page and click on the request in the list. Should show all headers)