Hi, i am using CEF3 in multi-process mode.
How to use CefCookieManager to give every browser of same application a different session?
agitech wrote:Hi, i am using CEF3 in multi-process mode.
How to use CefCookieManager to give every browser of same application a different session?
///
// Called on the IO thread to retrieve the cookie manager. |main_url| is the
// URL of the top-level frame. Cookies managers can be unique per browser or
// shared across multiple browsers. The global cookie manager will be used if
// this method returns NULL.
///
/*--cef()--*/
virtual CefRefPtr<CefCookieManager> GetCookieManager(
CefRefPtr<CefBrowser> browser,
const CefString& main_url) { return NULL; }
CefRefPtr<CefCookieManager> ClientHandler::GetCookieManager(
CefRefPtr<CefBrowser> browser,
const CefString& main_url){
std::string cache_path = "K:/cef_cache/";// should be retrived from browser host setting, but i will find how later
CefString cookie_path = cache_path+ "cookie_"+std::to_string((long double)browser->GetIdentifier());
return CefCookieManager::CreateManager( cookie_path, false);
}
agitech wrote:This code create a cookie path for every browser with the cache_path like : K:/cef_cache/cookie_1 , K:/cef_cache/cookie_2 , K:/cef_cache/cookie_3 ...
But it crach just after the return , any idea ?
agitech wrote:But could any one tell me how correctly return a new CefCookieManager without craching the application?
agitech wrote:OK thanks, so you confirm that if a new CefCookieManager is returned on every request, the browser will not keep the session.
But could any one tell me how correctly return a new CefCookieManager without craching the application?
Users browsing this forum: No registered users and 142 guests