shdocVw Browser toolbar set cookie

  • Thread starter Thread starter mt
  • Start date Start date
M

mt

I am writing a browser toolstrip bar that sits in IE. How do I set a cookie
in the browser for a specific domain before the user navigates to that domain.
I only have access to IE as an SHDocVw.WebBroswerClass
I am trying to set the cookie using

mshtml.HtmlDocument.cookie="name=value;domain=.example.com";

but when I try listening for BeforeNavigate2 event on the browser, the
document field in ShDocVw.IWebBrowser2 is an HTMLDocument in the wrong
domain, so the cookie doesn't get set and is not inlcuded in the request to
the server, and I get an error for not having the cookie.

How have other people gotten around this problem with the shDocVw and mshtml
packages?
 
Back
Top