sikmah 66
sikmah 66

Reputation: 1

Sketchware Webview won't accept/work with cookies for user session

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.

Upvotes: 0

Views: 365

Answers (1)

ANDROID PRIME
ANDROID PRIME

Reputation: 118

Try to use:

     public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
             
         }
 
     public void onPageFinished(WebView view, String url) {
             CookieSyncManager.getInstance().sync();
         }
});

Upvotes: 0

Related Questions