So some guy at some other company thought it would be awesome if instead of using soap or xml-rpc or rest or any other reasonable communication protocol he just embedded all of his response as cookies in the header.
I need to pull these cookies out as hopefully an array from this curl response. If I have to waste a bunch of my life writing a parser for this I will be very unhappy.
Does anyone know how this can simply be done, preferably without writing anything to a file?
I will be very grateful if anyone can help me out with this.
My understanding is that cookies from
curl
must be written out to a file (curl -c cookie_file
). If you're runningcurl
through PHP'sexec
orsystem
functions (or anything in that family), you should be able to save the cookies to a file, then open the file and read them in.libcurl also provides CURLOPT_COOKIELIST which extracts all known cookies. All you need is to make sure the PHP/CURL binding can use it.