简体   繁体   中英

How to add cookie in ChromiumWebBrowser browser for WPF

How i can add cookie to ChromiumWebBrowser before navigating to a URL.

I have a URL which I want to navigate, however I would like to add authToken cookie before navigating to avoid going to Login page.

Please suggest

I have used below code to add authentication Token cookie before navigating to specific URL and avoid going to Login page.

var mngr = Cef.GetGlobalCookieManager();
Cookie Ac = new Cookie();
Ac.HttpOnly = true;
Ac.Name = ".ASPXAUTH";
Ac.Value = "";
mngr.SetCookieAsync(matrixUrl.ToString(), Ac);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM