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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top