Help with Cookie in Webbrowser

I am using Webbrowser to navigate a web. But the site set cookies in the web page. I want to clear them I tried that with

webBrowser.Document.Cookie = "";

and

webBrowser.Document.Cookie = "xxx=";

that does not affect the value without plus "xxx=;" before original value "xxx=WERQFA...".

How would I clear the Cookies




Answer this question

Help with Cookie in Webbrowser

  • Jim Kiser

    I want to delete cookies saved in the webbrowser control by application!

  • C#

    Hi

    if you want to delete cookies using ASP.net

    else delete your cookies from the web browser Tools> Options> Delete Cookies or get the folder name Cookies and delete everthing in that folder.

    Hope this helps.



  • ayou

    Did you ever find a resolution to this issue I am attempting to do the exact same thing. I have a WebBrowser control hosted in a winforms app, hosted in a XAML app, and I need to delete the cookie from the browser control.

    I tried .Cookie = null;
    and the other methods as well...

    MS, any ideas

    Thanks in advance,
    Tommy

  • stripendulous

    Hi

    11: //Set the cookie to expire in 1 minute
    12: DateTime dtNow = DateTime.Now;
    13: TimeSpan tsMinute = new TimeSpan(0, 0, 1, 0);
    14: cookie.Expires = dtNow + tsMinute;

    By setting the time to disable a cookie, it will get deleted automatically



  • Help with Cookie in Webbrowser