Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. QtWebEngine cannot save cache

QtWebEngine cannot save cache

Scheduled Pinned Locked Moved Solved Qt 6
4 Posts 3 Posters 1.1k 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.
  • I Offline
    I Offline
    ishiy
    wrote on last edited by ishiy
    #1

    Hello,
    When I used Qt6.2.0 with my windows program that uses QtWebEngine, the cache and cookies were not saved.

    I tried running Qt/Examples/Qt-6.2.0/webenginewidgets/cookiebrowser with Qt5.15.2 and Qt6.2.0, and it seems that cookies are saved with Qt5, but not with Qt6.
    I added QWebEngineProfile::defaultProfile()->setPersistentCookiesPolicy(QWebEngineProfile::ForcePersistentCookies);, but it didn't work.
    How can I enable cache saving in Qt6?

    1 Reply Last reply
    0
    • I Offline
      I Offline
      ishiy
      wrote on last edited by
      #2

      Resolved.
      https://doc-snapshots.qt.io/qt6-dev/qtwebengine-changes-qt6.html

      Default Profile
      The default profile is now off the record.
      To have a standard browser profile with disk-cache and cookies, we recommend creating your own profile and using that explicitly.

      So, I used m_webview->setPage(new QWebEnginePage(new QWebEngineProfile("MyProfile"))); instead of QWebEngineProfile::defaultProfile()->setPersistentCookiesPolicy(QWebEngineProfile::ForcePersistentCookies);, and it worked.

      1 Reply Last reply
      0
      • K Offline
        K Offline
        Kevin_Burns
        wrote on last edited by
        #3

        Hey, I wanted to check-in on this item; I know it was resolved back in 2021 for this case, but since updating to QT 6.8, even with creating a profile and setting the cache/cookie to save to disk, it doesn't seem to "remember" when logging out and back into KDE. Any insight, or maybe point me in the right direction, would greatly be appreciated.

        1 Reply Last reply
        0
        • 1 Offline
          1 Offline
          19LeTtErS
          wrote on last edited by
          #4

          Hi @Kevin_Burns, did you ever work out what your problem was? I am on QT 6.8, am pretty sure I have done everything the documents say to do, but cannot get the cache and cookies to persist.
          Thanks

          1 Reply Last reply
          0

          • Login

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