I made this example to try to understand why I don’t send cookies at all using my WebBrowser, it’s pretty simple, it has a WebBrowser, that’s all:
namespace BrowserTest
{
public partial class Form1 : Form
{
[DllImport("wininet.dll", CharSet = CharSet.Auto, SetLastError = true)]
private static extern bool InternetSetCookie(string url, string name, string data);
public static bool SetWinINETCookieString(string url, string name, string data)
{
return Form1.InternetSetCookie(url, name, data);
}
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
SetWinINETCookieString("www.nonexistent.com", "dataToTest", "thisIsTheData");
this.webBrowser1.Navigate("www.nonexistent.com");
}
}
}
And what Fidler says I am sending:

It seems that everyone who uses this feature is doing well, but for me life is that I can't get it to work. I tried on different computers and it also fails. Any help would be great, thanks.
source
share