I have the following console application written in VB.NET:
Sub Main()
Dim ie As Object = CreateObject(\"InternetExplorer.Application\")
ie.Visible =
With respect of CreateObject("InternetExplorer.Application")
you create an instance of Internet Explorer and all instances of you program communicate through this one process. Cookies will be hold per process.
You can try to use in your application WebBrowser
control instead (see http://msdn.microsoft.com/en-us/library/3s8ys666.aspx). You find in http://msdn.microsoft.com/en-us/library/aa752044(VS.85).aspx information which compare two ways. If you will use WebBrowser
control in you application all instances of your application will have his own set of cookies, but only one set of cookies per process independent on the number of WebBrowser
controls in your application.
Inside of any process you can any time clear the cookie with respect of following call
InternetSetOption(IntPtr.Zero, INTERNET_OPTION_END_BROWSER_SESSION, IntPtr.Zero, 0);
(see http://support.microsoft.com/kb/195192/en) which shows one more time the nature of cookies holding.