Set a cookie to a webView in Android

前端 未结 6 1672
挽巷
挽巷 2020-12-05 07:13

I\'m getting a HttpResponse from a server when checking if a username or password is correct. When I load the url in a webview I want

6条回答
  •  Happy的楠姐
    2020-12-05 07:45

    You may want to take a look of how I am setting the a webview cookie at :

    Android WebView Cookie Problem

    Where in my answer you could see how I'm handling this like:

    val cookieManager = CookieManager.getInstance()
    cookieManager.acceptCookie()
    cookieManager.setCookie(domain,"$cookieKey=$cookieValue")
    cookieManager.setAcceptThirdPartyCookies(view.webViewTest,true)
    

提交回复
热议问题