开发者

InternetGetCookie does not retrieve all cookies

I am trying to use InternetGetCookie in order to ret开发者_如何学JAVArieve cookies from IE. The problem I have is that sometimes in a cookie file there may be 2 or even 3 different cookies but InternetGetCookie always retrieves the data associated with only the first cookie. I tried calling InternetGetCookie twice in a row for the same cookie url but it all it does is two retrieve the first cookie data twice. Thanks!


Where (what process) is your code running in? What do you mean when you when you say "same cookie url"?

Some notes:

  • InternetGetCookie will not return HTTPOnly cookies by default
  • InternetGetCookie will return only persistent cookies and session cookies from the current process. It does not see session cookies from other processes.
  • On Vista+, InternetGetCookie will not return cookies from Protected Mode processes

http://blogs.msdn.com/b/ieinternals/archive/2009/08/20/wininet-ie-cookie-internals-faq.aspx


InternetGetCookie returns all cookies separated by ';' symbol.


It does not return HttpOnly marked cookie. See if your second cookie is HttpOnly marked. If it is so then use InternetGetCookieEx() with INTERNET_COOKIE_HTTPONLY Flag.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜