How do I use INTERNET_HANDLE_TYPE_INTERNET to constrain the effects of END_BROWSER_SESSION to the current WebBrowser?
<p>We have a WebBrowser that needs to have login information reset. </p>

<p>There is a solution in <a href="http://stackoverflow.com/questions/1335617/is-it-possible-to-sandbox-ie-in-a-windows-form">this</a> question that suggests using <code>INTERNET_HANDLE_TYPE_INTERNET</code> with <code>INTERNET_OPTION_END_BROWSER_SESSION</code>. However, I'm not sure where <code>INTERNET_HANDLE_TYPE_INTERNET</code> should go.</p>

<pre><code>private const int INTERNET_OPTION_END_BROWSER_SESSION = 42;
private const int INTERNET_HANDLE_TYPE_INTERNET = 1;

[DllImport("wininet.dll", SetLastError = true)]
private static extern bool InternetSetOption(IntPtr hInternet, int dwOption, 
    IntPtr lpBuffer, int lpdwBufferLength); 
</code></pre>

<p>I call it right before I navigate:</p>

<pre><code>InternetSetOption(IntPtr.Zero, INTERNET_OPTION_END_BROWSER_SESSION, IntPtr.Zero, 
    0);              
browserCtrl.WebBrowser.Navigate(loginUrl);
</code></pre>
