PHP cURL isn't storing the session cookie... How to fix this? PHP cURL isn't storing the session cookie... How to fix this? curl curl

PHP cURL isn't storing the session cookie... How to fix this?


The CURLOPT_COOKIE option is for sending a particular cookie using CURL. The options you are looking for are CURLOPT_COOKIEFILE and CURLOPT_COOKIEJAR, which specify a file to save and load cookie from.

So you'll have to do something like this:

curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookies.txt');curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies.txt');