Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: cURL and handleing cookies
05-12-2009, 12:10 PM #1
- Join Date
- Mar 2008
- Thanked 0 Times in 0 Posts
cURL and handleing cookies
So what I want to do is create a cURL snippplet that will POST data somewhere , get the cookies from the response, sends them to a txt file to be used to call upon another URL.
Then I want it to grab the value of one certain cookie and echo it. (Preferably not from the txt file , but from the set cookie headers.
So for example, if it sets multiple cookies. (like Set-Cookie:Auth1=abcdefg;Auth2=hijk; ) , I just want the value of the Auth2 cookie that was set in the original process.
05-12-2009, 01:39 PM #2
The PHP documentation for CURL is quite poor, however the differences between the PHP front-end and the C source code for the module are minimal.
So if you are conversant with C, you might like to have a look at this file: http://curl.haxx.se/dev/COOKIES
Sorry I can't be more specific, I haven't ever needed to do what you're trying to do.
EDIT: Perhaps the CURLINFO_HEADER_OUT option with curl_getinfo might help you. I don't know though.
EDIT 2: This might help you: http://uk3.php.net/manual/en/reserve...onseheader.php Or this: http://uk3.php.net/manual/en/function.get-headers.php
Last edited by mlse; 05-14-2009 at 10:56 AM.
Die Welt ist ein Irrenhaus und hier ist die Zentrale!