Jump to content

Archived

This topic is now archived and is closed to further replies.

rickster99

Libcurl Suggestion

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!

 

Share this post


Link to post
Share on other sites

Never seen that problem before....

 

 

You could always just use sockets and do headers your self.  But chances are, it's either a known issue, or something with your code is wrong.

Share this post


Link to post
Share on other sites

×
×
  • 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.