cefsharp / CefSharp

.NET (WPF and Windows Forms) bindings for the Chromium Embedded Framework
http://cefsharp.github.io/
Other
9.89k stars 2.92k forks source link

how to make ChromiumWebBrowser have standalone cookies #1836

Closed duoduoxi closed 8 years ago

duoduoxi commented 8 years ago

Hi,all I used same ChromiumWebBrowser in my program, now all ChromiumWebBrowser shared the same cookies, Is there any way to make ChromiumWebBrowser have standalone cookies ?

Thanks.

amaitland commented 8 years ago

So you have a question to ask, where can you look for answers?

Please take the time to read the issue template, if you have a question, ask it on Gitter first. https://github.com/cefsharp/CefSharp/blob/master/ISSUE_TEMPLATE.md

amaitland commented 8 years ago

@duoduoxi Please read the issue template next time.

Isolation is achieved using a RequestContext. If you specify a unique cache for each unique RequestContext you should have cookie isolation. You can share a RequestContext between multiple instances.

browser.RequestContext = new RequestContext(new RequestContextSettings { CachePath = "cache1" });

https://github.com/cefsharp/CefSharp/blob/5248174f894cba94c11bdf4aefe6b74383326d6c/CefSharp.Wpf.Example/Views/BrowserTabView.xaml.cs#L44

duoduoxi commented 8 years ago

@amaitland Sorry , I am not familiar with github. I will ask question on gitter next time. Thank you very much.