note 91509 added to function.curl-setopt
| From: | Andrew at osu1 dot php dot net | Date: | Sun, 14 Jun 2009 11:56:03 +0000 |
| Subject: | note 91509 added to function.curl-setopt | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-156846@lists.php.net to get a copy of this message | ||
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.
----
Server IP: 91.199.167.18
Probable Submitter: 82.192.88.45
----
Manual Page -- http://www.php.net/manual/en/function.curl-setopt.php
Edit -- https://master.php.net/note/edit/91509
Del: integrated -- https://master.php.net/note/delete/91509/integrated
Del: useless -- https://master.php.net/note/delete/91509/useless
Del: bad code -- https://master.php.net/note/delete/91509/bad+code
Del: spam -- https://master.php.net/note/delete/91509/spam
Del: non-english -- https://master.php.net/note/delete/91509/non-english
Del: in docs -- https://master.php.net/note/delete/91509/in+docs
Del: other reasons-- https://master.php.net/note/delete/91509
Reject -- https://master.php.net/note/reject/91509
Search -- https://master.php.net/manage/user-notes.php