[PyQt] QWebEngineProfile does not save or restore cookies in PyQt, but works with Qt

xiangxw5689 xiangxw5689 at 126.com
Mon Mar 20 06:12:27 GMT 2017


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();
}








At 2017-03-11 00:28:18, "Florian Bruhin" <me at the-compiler.org> wrote:
>* xiangxw5689 <xiangxw5689 at 126.com> [2017-03-11 00:25:50 +0800]:
>> 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 | me at 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/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20170320/26920723/attachment.html>


More information about the PyQt mailing list