Discussion:
[PyQt] QWebEngineProfile does not save or restore cookies in PyQt, but works with Qt
xiangxw5689
2017-03-10 16:25:50 UTC
Permalink
Tested with Python 3.5 + PyQt 5.8.1
The pyqt test script is attached.
Sign in a website, close it, restart, the cookie(username and password) should be remembed.
Work with Qt but not with PyQt. Thanks.
Florian Bruhin
2017-03-10 16:28:18 UTC
Permalink
Post by xiangxw5689
Tested with Python 3.5 + PyQt 5.8.1
The pyqt test script is attached.
Sign in a website, close it, restart, the cookie(username and password) should be remembed.
Work with Qt but not with PyQt. Thanks.
It works with both if you wait 30s and works with neither if you
don't. See https://bugreports.qt.io/browse/QTBUG-58675

Florian
--
http://www.the-compiler.org | ***@the-compiler.org (Mail/XMPP)
GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc
I love long mails! | http://email.is-not-s.ms/
xiangxw5689
2017-03-20 06:12:27 UTC
Permalink
Hi, it does work with Qt. But not work with PyQt. Both with version 5.8. Here is the test code.

#include <QtWebEngineWidgets>
#include <QApplication>

int main(int argc, char *argv[])
{
QApplication a(argc, argv);

auto profile = QWebEngineProfile::defaultProfile();
profile->setCachePath("chromium_cache");
profile->setPersistentStoragePath("chromium_storage");
profile->setPersistentCookiesPolicy(QWebEngineProfile::ForcePersistentCookies);

QWebEngineView view;
view.load(QUrl("https://github.com/"));
view.show();

return a.exec();
}
Post by Florian Bruhin
Post by xiangxw5689
Tested with Python 3.5 + PyQt 5.8.1
The pyqt test script is attached.
Sign in a website, close it, restart, the cookie(username and password) should be remembed.
Work with Qt but not with PyQt. Thanks.
It works with both if you wait 30s and works with neither if you
don't. See https://bugreports.qt.io/browse/QTBUG-58675
Florian
--
GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc
I love long mails! | http://email.is-not-s.ms/
Loading...