Important: Please read the Qt Code of Conduct -

Reset WebEngineView user session

  • Hello,

    I use a WebEngineView to disploay a page with google / facebook / twitter... OAuth login page. My goal is to give user the abilities to post a image to their account.

    Several users will use the application.

    My problem : the first user log into google (or other) using OAuth. For the next one, the first user session still active : session is in WebEngine cache.

    How can I "reset" the WebEngineView ? Clear all cache / cookie / session....

    I have already tryed to

    • set "profile.offTheRecord" --> Improvement : when I close and reload the application, login page is shown again --> cache clean
    • Destroy and create dynamicaly the WebEngineView with a Qt.createComponent --> No Improvement
    • Force the profile with a "default profile" (see below) --> No Improvement

    property QtObject defaultProfile: WebEngineProfile {
    storageName: "Default"
    offTheRecord: true

    MyScriptWV.url = url;
    MyScriptWV.webView.wv.profile = defaultProfile;

    Can someone help me ?

  • @ratwix I have found the solution : for each new connection, dynamicaly create a new WebEngineProfile with offTheRecord and new storage name (needed ?) and assign it to the current WebEngineView

Log in to reply