Cookies not sent in WebBrowser? (C#, VS2008)
- by Ivan
Hi, I'm trying to add cookies to a webbrowser from a cookiecollection. I add them as they should be added but then they are not sent when the request is done.
Here is the code I have done hitherto:
public void myNav(string url, CookieCollection cc)
{
foreach (Cookie cook in cc)
{
webBrowser1.Document.Cookie = cook.ToString();
}
this.webBrowser1.Navigate(url);
Clipboard.SetText(webBrowser1.Document.Cookie);
}
If I copy the cookies to the clipboard they are sent correctly, but If I analyse the request with Wireshark they are not sent in the headers.
How can I solve this?
Thanks in advance,
Ivan