Setting Cookie Session id in PHP CURL
This example code will help to set cookie or session id in CURL. By default there is no cookie will be set.$c = curl_init();
curl_setopt($c, CURLOPT_URL, 'http://www.example.com/');
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_COOKIE, "Cookie: cookieVariable=cokieValue; PHPSessionId=sntbiaj53dska4ryxgmc0su5");
$html = curl_exec($c); 