From 4c70c67042ffdf2ac52be3171c89f192e2738b82 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Thu, 25 Jul 2019 15:27:15 -0400 Subject: [PATCH] Fix option for persisting session cookies (fixes issue #2720, see issue #2622) --- libcef/browser/browser_context.cc | 4 ++++ libcef/browser/browser_context.h | 3 +++ 2 files changed, 7 insertions(+) diff --git a/libcef/browser/browser_context.cc b/libcef/browser/browser_context.cc index b6ad7ca1a..00e4e5c30 100644 --- a/libcef/browser/browser_context.cc +++ b/libcef/browser/browser_context.cc @@ -288,6 +288,10 @@ void CefBrowserContext::Initialize() { CefString(&context->settings().accept_language_list); } + if (!!settings_.persist_session_cookies) { + set_should_persist_session_cookies(true); + } + key_ = std::make_unique(GetPath()); SimpleKeyMap::GetInstance()->Associate(this, key_.get()); diff --git a/libcef/browser/browser_context.h b/libcef/browser/browser_context.h index 23bcd82df..3e2073971 100644 --- a/libcef/browser/browser_context.h +++ b/libcef/browser/browser_context.h @@ -189,6 +189,9 @@ class CefBrowserContext : public ChromeProfileStub, // Values checked in ProfileNetworkContextService::CreateNetworkContextParams // when creating the NetworkContext. + bool ShouldRestoreOldSessionCookies() override { + return should_persist_session_cookies_; + } bool ShouldPersistSessionCookies() override { return should_persist_session_cookies_; }