I want to be able to take the cookie information from website a, and then set the cookie on website b.
So when a user visits website b, website b automatically sets the cookies it receives from website a
I have been working on a few attempts to retrieve things using cURL in php.
This is what I have at the moment:
$a = curl_init('http://www.website.com');
curl_setopt($a, CURLOPT_COOKIEFILE);
curl_setopt($a, CURLOPT_RETURNTRANSFER, 1);
$name = curl_Exec($a);
curl_close($a);
$b = curl_init('http://www.website.com');
curl_setopt($b, CURLOPT_COOKIE);
curl_setopt($b, CURLOPT_RETURNTRANSFER, 1);
$value = curl_Exec($b);
curl_close($b);
setcookie('$name','$value');
Obviously, it isn't working.
I'm new to cURL, I'm not sure if what I am trying to do can be done (or should be).
Thank you for your help!