by sunswam » Fri Sep 08, 2017 7:14 pm
I have a follow up question of using the global cookiemanager. I have a situation where i need to cache the cookies in a file that our application has defined and restore the cookies back to the CEF cookie manager next time when the application is started. If i use the SetStoragePath API, then CEF cookie file is handling nicely all of the scenarios i wanted. But i am constrained because other components in our application which doesn't use CEF has to have the cookies information shared ( single sign-on/sign off implementation across different components ).
When i restore the cookies i read array of cookies ( json ) format and try to set it using the following in the browser process ( IO thread ):
//array of CefCookie objects are read ( from JSON file )
//following is called in a loop.
CefPostTask(TID_IO, CefCreateClosureTask(base::Bind(base::IgnoreResult(&CefCookieManager::SetCookie),
manager,
CefString("https://test.url.com"), // There is a initial URL that gets loaded but then this page redirects to several other pages before success page.
cookie,
nullptr)));
Can i set the cookies based on domain that i got from CefCookie object or do i have to know each URL that it navigates to be set it in the Setcookie function?. Please clarify.