android webview setCookie

CookieManager.getInstance().setCookie("http://api.credit.unicc.dev", "token=f7fcf513c1e3803c4e86")

要允许 cookie 跨域 得调用 : setAcceptThirdPartyCookies

if (Build.VERSION.SDK_INT >= 21) {
   CookieManager.getInstance().setAcceptThirdPartyCookies(webView, true)
}

android 5.0 及以后要手动设置允许 cookie 跨域

你可能感兴趣的:(android webview setCookie)