note 91509 deleted from function.curl-setopt by danbrown

From: Date: Sun, 14 Jun 2009 14:14:00 +0000
Subject: note 91509 deleted from function.curl-setopt by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-156851@lists.php.net to get a copy of this message
Note Submitter: Andrew ---- I noticed that if you want to get current cookie file after curl_exec() - you need to close current curl handle (like it said in manual), but if you want cookies to be dumped to file after any curl_exec (without curl_close) you can: #call it normally $ch = curl_init(); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_COOKIEFILE, "cookiefile"); curl_setopt($ch, CURLOPT_COOKIEJAR, "cookiefile"); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_URL, 'http://avtoproblemi.ru'); $result1 = curl_exec($ch); #and then make a temp copy $ch_temp=curl_copy_handle(ch); curl_close($ch); $ch=$ch_temp; Only this way, if you close $ch_temp - cookies wont be dumped.

« previous php.notes (#156851) next »