[SOLVED]Where does WebEngineView save cookies on OS X and how do I keep it from saving cookies?
-
wrote on 14 Aug 2015, 09:04 last edited by Hertzy
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?
-
wrote on 14 Aug 2015, 10:11 last edited by
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.
-
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.
wrote on 14 Aug 2015, 18:38 last edited by@Hertzy You can stop saving cookies by setting a policy:
http://doc.qt.io/qt-5/qml-qtwebengine-webengineprofile.html -
wrote on 17 Aug 2015, 08:34 last edited by
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.
-
wrote on 19 Aug 2015, 12:42 last edited by
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.
1/5