It is tab delimited and unfortunately you will have to parse it yourself if you want to do anything beyond copying the cookies.
To clear the in memory cookies for a c URL handle you can use: curl_setopt($curl, CURLOPT_COOKIELIST, "ALL"); This is a magic string. If a magic string isn't used, this field should take a cookie in the same string format as in getinfo for the cookielist constant.
You can also copy cookies from one handle to another like so: foreach(curl_getinfo($curl_a, CURLINFO_COOKIELIST) as $cookie_line) curl_setopt($curl, CURLOPT_COOKIELIST, $cookie_line); An inelegant way to delete a cookie would be to skip the one you don't want.
I only recommend using COOKIELIST with magic strings because the cookie format is not secure or stable.
The callback "string" can be any callable function, that includes the array(&$obj, 'some Method Name') format.
-Philippe It is important that anyone working with c URL and PHP keep in mind that not all of the CURLOPT and CURLINFO constants are documented.
write_function must return the exact number of bytes of the string, so you can return a value with mb_strlen.
If you only want to enable cookie handling and you don't need to save the cookies for a separate session, just set CURLOPT_COOKIEFILE to an empty string.
So I will talk about what I found with PHP 5.6 and curl 7.26.
If you want to manage cookies in memory without using files including reading, writing and clearing custom cookies then continue reading.
Please everyone, stop setting CURLOPT_SSL_VERIFYPEER to false or 0.
If your PHP installation doesn't have an up-to-date CA root certificate bundle, download the one at the curl website and save it on your server: set a path to it in your file, e.g.
To start with, the way to enable in memory only cookies associated with a c URL handle you should use: curl_setopt($curl, CURLOPT_COOKIEFILE, "");c URL likes to use magic strings in options as special commands.