What version of CEF are you using? CEF3 only has VisitAll and VisitURL, both of them are asynch:
- Code: Select all
http://magpcss.org/ceforum/apidocs3/projects/(default)/CefCookieManager.html
http://magpcss.org/ceforum/apidocs3/projects/(default)/CefCookieVisitor.html
All returns cookies for every subdomain. URL returns cookies for a specific site.
You create a subclass of CefCookieVisitor like MyCookieVisitor and pass that to the cookie manager. It has a Visit function that will be called once per cookie. That Visit function can do something with the cookie, or set flags or cache the cookie data into a pair of string lists or whatever.
After cookie manager has sent all cookies to the Visit function, the destructor for your MyCookieVisitor object is called. At that point you can again do whatever you want -- search the cookie data if you built string lists, look at flags that you set, set cookies, etc.
Edit: just to be clear, you only need to do this to
read cookies. To set cookies you just get the cookie manager and then call SetCookie once per cookie = name-value pair.