Remove All Cookies GecokFX

Remove All Cookies GecokFX

Added by Nasir Mahmood updated on Thursday, October 23, 2014

Problem:

Sometimes we want to clear out all existing cookies from browser history programmatically. Fortunately GeckoFX provide us this facility by following snippet we can remove all cookies from browser history.


nsICookieManager CookieMan;
CookieMan = Xpcom.GetService<nsicookiemanager>("@mozilla.org/cookiemanager;1");
CookieMan = Xpcom.QueryInterface<nsICookieManager>(CookieMan);
CookieMan.RemoveAll();
                

Usage:

Place above code where you want to clear cookies i.e before browser navigate method.

About

29 Tutorials
25 Snippets
6 Products

More

Contact Us

Contact us

Stay Connected