note 102591 deleted from function.curl-copy-handle by danbrown

From: Date: Wed, 23 Feb 2011 15:48:33 +0000
Subject: note 102591 deleted from function.curl-copy-handle by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-177253@lists.php.net to get a copy of this message
Note Submitter: lxyfirst at 163 dot com ---- There is a crash when use cookie with curl_copy_handle as below: $url = "http://www.google.com.hk" ; $cookie_file = tempnam("/tmp","curl") ; $curl_handle= curl_init() ; curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl_handle, CURLOPT_COOKIEJAR, $cookie_file); curl_setopt($curl_handle, CURLOPT_COOKIEFILE, $cookie_file); curl_setopt($curl_handle, CURLOPT_URL, $url); $return_data = curl_exec($curl_handle); $curl_tmp = curl_copy_handle($curl_handle); curl_close($curl_handle) ; $cookie_data = file_get_contents($cookie_file) ; var_dump($cookie_data) ; //first request success $curl_handle = $curl_tmp ; curl_setopt($curl_handle, CURLOPT_URL, $url); $return_data = curl_exec($curl_handle); //second request crash here

« previous php.notes (#177253) next »