Hey, I'm a fairly advanced PHP developer and usually don't have many problems I need to ask help with, however, I have come across a recent problem that I can't seem to find a solution to. A script that I am writing requires me to use libcurl to connect to another website. I am using cURL and regex to get a list of recent private message notifications. Thusly, I need cookies to sign into my account. The site, however, does not seem to conform to RFC 2109.
What I am faced with is this:
CookieName=CookieValue1=Foo&CookieValue2=Bar
What I do not understand, is how my browser can even interpret this. I thought the Netscape/Mozilla cookie standard was this:
CookieName=CookieValue; CookieName2=CookieValue2
The site has a cookie, that I will call below call SiteCookie. The value has equal signs in it, which should be invalid. It appears that the cookie uses a URI style syntax. The userid, some various settings, and md5 hash are stored in the same cookie, which makes no sense to me. At least, they should have used a delimiter. I'll show you exactly what I am dealing with in standard 'Name'='Value' format:
'SiteCookie'='userid=47&miscboolsettings=1&auth=md5hash'
I've tried all I could to get curl_setopt($ch, CURLOPT_COOKIE, $cookie) to work. It will not interpret it. I've also tried SETOPT_COOKIEFILE (redundantly the same), and CURLOPT_HTTPHEADER. PHP won't assume what I am entering is correct. Basically, it isn't correct. I don't know how this is working. I've checked in multiple browsers, used HTTP header interception, tried using %3D. Nothing works!
I wonder if any of you might have any idea what is going on. This isn't like any other cookie I've dealt with before. Can libcurl even handle it?
Thanks for your help.