How can I set and delete cookies for a domain in webbrowser control without using Javascript (which doesn't allow to set / delete cookies without navigating to the website first.)
views:
721answers:
2You can't delete cookies for a domain other than the domain of the current site.
To do what you are asking requires you have access to the machine (i.e. toolbar installed). Even then it's kludgy.
The only exception is if you are on a domain where the cookie is using the * wildcard, for example *.stackoverflow.com. If you change a cookie with the wildcard, then all the child sub domains (i.e. blog.stackoverflow.com) will have access and see the change that was made to the cookie.
IE Uses WinInet functions for networking so you can use WinInet's cookie functions to change the cookie. Update: The requirement demands per-process setting. Since the cache folder location is not stored in IE settings registry key IDocHostUIHandler2::GetOverrideKeyPath won't work. I don't know a way to customize the cookie folder location at the process level except to hook all WinInet APIs (and stuck with updating application to accommodate future WinInet APIs).