views:

160

answers:

1

Is it possible to detect whether cookies are enabled in Internet Explorer through the IWebBrowser2 Interface or through some other WebBrowser Control C/C++ interface? I can't see any obvious way to do it, but was wondering whether there is a subtle way.

+1  A: 

You can pass the URL to InternetGetPerSiteCookieDecision() and it should tell you what the policy is for that site.

It is a pretty terribly named API. :-/

jeffamaphone
But accepting cookies is a local setting in your browser. You can either accept, block, or prompt for both first-party cookies and third-party cookies. I don't see how this is dependent on particular sites.
Paul Reiners
Yes, but you can also override it on a per-site bases (Tools -> Internet Options -> Privacy -> Sites (in IE8)). This API will take all of the above into account.
jeffamaphone