rickster99 Posted January 14, 2009 Share Posted January 14, 2009 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! Quote Link to comment https://forums.phpfreaks.com/topic/140859-libcurl-suggestion/ Share on other sites More sharing options...
corbin Posted January 15, 2009 Share Posted January 15, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/140859-libcurl-suggestion/#findComment-737476 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.