Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.3.0
Description
以5.15.2和6.3.0的cookiebrowser例子为测试工程。
Examples\Qt-5.15.2\webenginewidgets\cookiebrowser在访问几个网站后,重新启动exe,loadAllCookies 之后会读取上次的Cookie。
Examples\Qt-6.3.0\webenginewidgets\cookiebrowser的
MainWindow::MainWindow构造函数中
,简单修改如下:
QWebEngineProfile * engineProfile = new QWebEngineProfile("test");
m_webview->setPage(new QWebEnginePage(engineProfile, m_webview));
QString strTemp = "f:/webcache/cache";
engineProfile->setHttpCacheType(QWebEngineProfile::DiskHttpCache);
engineProfile->setPersistentCookiesPolicy(QWebEngineProfile::AllowPersistentCookies);
engineProfile->setCachePath(strTemp);
strTemp = "f:/webcache/storage";
engineProfile->setPersistentStoragePath(strTemp);
m_store = engineProfile->cookieStore();
connect(m_store, &QWebEngineCookieStore::cookieAdded, this, &MainWindow::handleCookieAdded);
m_store->loadAllCookies();
m_webview->load(url);
同样,先访问几个网站后,重新启动exe,loadAllCookies 之后并没有读取上次的任何Cookie,但是网页本身正确加载了上次保存的cookie(帐号的登录状态仍然保持)。
Attachments
Issue Links
- relates to
-
QTBUG-80605 tst_QWebEngineCookieStore::setAndDeleteCookie() Compared values are not the same
- Closed
Gerrit Reviews
For Gerrit Dashboard: QTBUG-102552 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
539833,1 | Make sure QWebEngineCookieStore::loadAllCookies() works as described | dev | qt/qtwebengine | Status: NEW | 0 | 0 |