* Thus wrote Jason Morehouse ([EMAIL PROTECTED]): > 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?
php's front page will only set one cookie, only in certain conditions will it set other cookies. I have 4 total from php.net: LAST_SEARCH, MYPHPNET, LAST_LANG, COUNTRY php only set's one cookie on the front page. Curt -- "I used to think I was indecisive, but now I'm not so sure." -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php