I'm trying to make a CURL request which passes a cookie to another website. I am not to sure if I am even doing this correctly my code is below. The code below I have tried but I have no clue whether the cookie is being passed it would appear not as the PHP echo shows no trace of the Cookie.
Source test page - This appears to not be sending the cookie properly.
$cSession = curl_init();
curl_setopt($cSession,CURLOPT_URL,"https://www.test.com/testpage.php");
curl_setopt($cSession,CURLOPT_RETURNTRANSFER,true);
curl_setopt($cSession,CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Cookie: test=cookie"));
curl_setopt($ch, CURLOPT_VERBOSE, true);
$result=curl_exec($cSession);
curl_close($cSession);
echo $result;
fclose($temp);
Target Curl Test Page
<?php
echo "You've Curled me ";
echo $_COOKIE['test'];
?>
Also is there a better way I can test if the cookie is sent other than JavaScript or PHP ?