Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Mar 2008
    Thanked 0 Times in 0 Posts

    Exclamation 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.

  • #2
    Regular Coder mlse's Avatar
    Join Date
    Mar 2005
    Thanked 19 Times in 18 Posts

    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 11:56 AM.
    Die Welt ist ein Irrenhaus und hier ist die Zentrale!


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts