Has anyone tried using curl to fetch a web page and cookies?


<?
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, 'http://www.php.net');
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_COOKIEJAR,'cookie.txt');
curl_setopt ($ch, CURLOPT_COOKIE,1);
$content = curl_exec ($ch);
curl_close ($ch);
$cookie = file_get_contents('cookie.txt');
print $cookie;
?>


This works fine, and the cookie gets stored in the cookie.txt file, but it
only ever returns 1 cookie. There should be 2 for php.net. Same with
pretty much any other site. Are there any configuration items I'm missing
for the cookie jar?


--
Jason Morehouse ([EMAIL PROTECTED])
Netconcepts LTD - Auckland, New Zealand

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to