0

I'm using Sketchware 6.4 and the latest Android OS, and for the life of me I can't get cookies to work with Weview.

I'm showing a simple PHPBB forum site using Webview (webview1) and want the user session to remain logged in when the app is closed and reopened. I've tried to set allow cookies and allow third party cookies to true prior to the URL being called to load, and nothing works.

I've tried using custom blocks from another Sketchware project and nothing works.

Can someone help please! It's a super basic app that literally opens a screen with a full-screen webview, and loads a PHPBB URL. How do I configure the app so that the cookies for the user session are saved so the user stays logged in?

Thanks!

I tried:

    CookieManager.getInstance().setAcceptCookie(true);

and

    if (android.os.Build.VERSION.SDK_INT >= 21) {   
     CookieManager.getInstance().setAcceptThirdPartyCookies(mWebView, true);
    } else {
     CookieManager.getInstance().setAcceptCookie(true);
    }

and the list goes on.

sikmah 66
  • 1
  • 1

1 Answers1

0

Try to use:

     public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
             
         }
 
     public void onPageFinished(WebView view, String url) {
             CookieSyncManager.getInstance().sync();
         }
});
ANDROID PRIME
  • 83
  • 1
  • 5
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 17 '23 at 07:14