virtual void Execute() { CefRefPtr<CefCookieManager> cookiemgr = CefCookieManager::GetGlobalManager(); if (m_szName.size()) cookiemgr->DeleteCookies(m_szUrl.c_str(), m_szName.c_str()); else cookiemgr->SetCookie(m_szUrl.c_str(), m_szCookie); }
void ClientApp::DeleteTestCookie(void) { CefRefPtr<CefCookieManager> manager = CefCookieManager::GetGlobalManager(); ASSERT(manager.get()); try { // manager->DeleteCookies(CefPath, &MyTestCookie.name); manager->DeleteCookies("", &MyTestCookie.name); } catch (std::exception &ex) { // Do nothing if(ex.what() == "") {} } }
void WebBrowserHost::ClearCookies(const String& url, const String& cookieName) { CefRefPtr<CefCookieManager> manager = CefCookieManager::GetGlobalManager(nullptr); if (!manager.get()) return; CefString cefUrl; cefUrl.FromASCII(url.CString()); CefString cefCookieName; cefCookieName.FromASCII(cookieName.CString()); manager->DeleteCookies(cefUrl, cefCookieName, nullptr); }