Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. [SOLVED]Where does WebEngineView save cookies on OS X and how do I keep it from saving cookies?

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

Scheduled Pinned Locked Moved QtWebEngine
os xwebengineviewlogin
5 Posts 2 Posters 5.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Hertzy
    wrote on 14 Aug 2015, 09:04 last edited by Hertzy
    #1

    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?

    1 Reply Last reply
    0
    • H Offline
      H Offline
      Hertzy
      wrote on 14 Aug 2015, 10:11 last edited by
      #2

      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.

      W 1 Reply Last reply 14 Aug 2015, 18:38
      0
      • H Hertzy
        14 Aug 2015, 10:11

        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.

        W Offline
        W Offline
        WaltPurvis
        wrote on 14 Aug 2015, 18:38 last edited by
        #3

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

        1 Reply Last reply
        1
        • H Offline
          H Offline
          Hertzy
          wrote on 17 Aug 2015, 08:34 last edited by
          #4

          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.

          1 Reply Last reply
          0
          • H Offline
            H Offline
            Hertzy
            wrote on 19 Aug 2015, 12:42 last edited by
            #5

            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 Reply Last reply
            0

            1/5

            14 Aug 2015, 09:04

            • Login

            • Login or register to search.
            1 out of 5
            • First post
              1/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved