Setting a cookie in a WebBrowser control
I am loading a website using a WebBrowser's Navigate function, and I want the browser to load the page with a cookie I've given it. The following code doesn't work: wb.Navigate(url, null, null, "Cookie: " + cookie + "\n"); What am I doing wrong? Will I have to use InternetSetCookie ? This doesn't seem like the best solution. Kiran Madipally Looks like there is a better way: Import the InternetSetCookie function: [DllImport("wininet.dll", CharSet = CharSet.Auto, SetLastError = true)] static extern bool InternetSetCookie(string lpszUrlName, string lpszCookieName, string lpszCookieData); Create