Reading a Web cookie from my app
Posted on 1997-05-01
I'm trying to read a cookie written by script embedded in an HTML page from a C++ application. I tried to use the InternetGetCookie() function (defined in wininet.h) but it always fails. GetLastError() returns the value:
which winerror.h defines as: "No more data is available." Presumably I'm giving this function an incorrect parameter but after trying every combination I could think of, nothing works.
I've checked the actual cookie directory and the cookie data does get written. I can write the code to read it myself but I’d like to avoid the hassle. Also, I'm afraid that the cookie format may change.
I'm using VC++ 5 and IE4.
Any help would be appreciated.