I am trying to access an admin routed url from a frontend routed URL using curl. I do the following:
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, 'http://site.com/index.php/admin/mycache/verify/');
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt ($ch, CURLOPT_COOKIE, $_COOKIE['adminhtml']);
$Verify = curl_exec($ch);
curl_close($ch);
echo "V: $Verify";
The idea here is that I want that url to return a 1 if the user is logged into the admin part of my site, and anything else otherwise. When I do the above though, even though the adminhtml cookie is set, curl never gets the data from that URL. Can someone explain why and/or how to fix that?