Jump to content

Recommended Posts

Hi everyone.  This is my first time on the board.  Thanks for having me here.

 

I was wondering if I could get your professional input on something that I am working on but is not exactly working the way it should or the way I think it should.

 

I have a script that uses libcurl to post parameters to a site and authenticate against the site.  The site issues cookies upon hitting the page with the URL and query string.  When I look at the headers that are being passed with a browser you can see that multiple cookies are being issued to the browser at the same time, please see below:

 

<-- START BROWSER HEADER RESPONSE SNIP-->

 

Content-Length: 543

Connection: Keep-Alive

Cache-Control: no-cache

Cookie: USCGSCVI=25574; OSCGSCVI=14554; ASP.NET_SessionId=pmkodu45tetdh2bl4bej2ru5

 

<-- END BROWSER HEADER RESPONSE SNIP -->

As you can see from above the browser is accepting multiple cookies, which are semicolon seperated.

 

Now, when you look at php and libcurls output during this process, what you end up getting is similar to the example above except that libcurl only accepts the first cookie.  When looking at the file that libcurl uses to store cookie information, this is what it stores:

 

<-- LIBCURL RESPONSE -->

# Netscape HTTP Cookie File

# http://curlm.haxx.se/rfc/cookie_spec.html

# This file was generated by libcurl! Edit at your own risk.

 

#HttpOnly_www.xxxxx.com      FALSE  /      FALSE  0      ASP.NET_SessionId      pmkodu45tetdh2bl4bej2ru5

<-- END LIBCURL RESPONSE -->

 

So basically what I can gather from this information is that libcurl is only getting the first cookie and omitting all others that are separated by semicolons.

 

Has anyone run into something like this?  Can you offer any advice?

 

Thanks in advance!

 

Link to comment
https://forums.phpfreaks.com/topic/140859-libcurl-suggestion/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.