I am using web browser and trying to change the cookies but the cookie remains null i donot know why
any idea why it does not changes.i tried to monitor but observed that the method InternetSetCookie is not changing it,but the page that was navigated to renders and page changes cookie not my method
[DllImport("wininet.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern bool InternetSetCookie(string lpszUrlName, string lbszCookieName, string lpszCookieData);
InternetSetCookie(textBox1.Text, null, "123");
webBrowser1.Navigate(textBox1.Text);
Don’t pass null for the cookie name. And do pay attention to the return value, you should get false here because of the invalid name. Use
throw new Win32Exception()so an error doesn’t go unnoticed.