【发布时间】:2024-01-19 11:08:01
【问题描述】:
我正在做一个项目,在我的应用程序中加载一个 web 视图(使用 Visual Studio 2012)。在加载 web 视图之前,我发送一个 curl 请求以获取一些 access_token,我需要在该特定 web 视图的 cookie 中设置它,以便用户自动登录该 web 视图。因此,在 curl 的回调中,当我获得令牌时,我在 cef 全局 cookie 管理器上调用 setCookie,但它总是返回我 false。
CefRefPtr<CefCookieManager> cookieManager=CefCookieManager::GetGlobalManager();
CefString cefURL ;
cefURL.FromString(url.GetUTF8String());
bool retVal = cookieManager->SetCookie(cefURL,cookie);
我是不是做错了什么,是不是因为我在 curl 回调上做错了,这是一个单独的线程。
【问题讨论】:
标签: c++ visual-studio curl webview chromium-embedded