You can't disable cookies only on your web browser control. The control is essentially an embedded Internet Explorer and shares the user's Internet Explorer settings. If you don't mind blocking cookies on all other instances of Internet Explorer (maybe you use Chrome or Firefox for the rest of your browsing) you can do the following:
(From: http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/90834f20-c89f-42f9-92a8-f67ccee3799a/)
To block Cookies in WebBrowser control you can take the following
steps, in fact, it's the same as to block Cookies in IE.
- Choose "Internet Options" under the "Tools" menu on the IE;
- Select the "Privacy" tab.
- Click the "Advanced..." button in the "Settings" groupbox.
- Check the "Override automatic cookie handling" option.
- Check both "Block" options.
- Click "OK"
You could also delete all the cookies after you visit a page, but I don't think this will fulfill your goal of being completely anonymous.
I did a little digging and I think you can use InternetSetOption and the INTERNET_SUPPRESS_COOKIE_PERSIST flag. According to the documentation, this will only work for Internet Explorer 8 and later.
private const int INTERNET_OPTION_SUPPRESS_BEHAVIOR = 3; //INTERNET_SUPPRESS_COOKIE_PERSIST - Suppresses the persistence of cookies, even if the server has specified them as persistent.
[DllImport("wininet.dll", SetLastError = true)]
private static extern bool InternetSetOption(IntPtr hInternet, int dwOption, IntPtr lpBuffer, int lpdwBufferLength);
Then when you initialize your app try:
InternetSetOption(IntPtr.Zero, INTERNET_OPTION_SUPPRESS_BEHAVIOR, IntPtr.Zero, 0);
Hopefully this puts you on the right track. See also:
How to set and delete cookies from WebBrowser Control for arbitrary domains
How do I use InternetSetOption?
Clear Cookies Cache for Multiple WebBrowser Control with WinInet in Winform Application