[SOLVED]Where does WebEngineView save cookies on OS X and how do I keep it from saving cookies?



  • I'm using WebEngineView to log in to a service via Google. The application was originally built on Windows and I'm now in the process of porting it to OS X. Currently, WebEngineView keeps using my old login credentials, and therefore skipping the login phase.

    I presume this is because I checked the "keep me logged in" box on one login, and now there is a cookie somewhere that WebEngineView loads every time I try to log in. Since I'd like to allow multiple users to log in from the same desktop, this is becoming a problem and I'd like to delete the first cookie and prevent further cookies from being stored. How do I go about this?



  • It appears that the cookies and other data are saved into ~/Library/Application Support/<appname>/QtWebEngine/Default/ Now, if only I knew how to stop the web view from saving those cookies in the first place.



  • @Hertzy You can stop saving cookies by setting a policy:
    http://doc.qt.io/qt-5/qml-qtwebengine-webengineprofile.html



  • It appears that I messed up the title. I meant to ask about QWebEngineView, the widget, which doesn't appear to have the ability to set a cookies policy. I'm just deleting the file via QFile when I'm done with the widget.



  • Disregard my previous post, cookies policy can be set in the QWebEngineProfile owned by the QWebEnginePage owned by the QWebEngineView, like this: ui->webView->page()->profile()->setPersistentCookiesPolicy(QWebEngineProfile::NoPersistentCookies);

    The page pointer remains the same for my purposes, at least.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.