android - Webview cookie 未更新
问题描述
Android Webview 加载了一个 API,首先,服务器发送未经身份验证的临时“FP”(cookie 名称)cookie 作为响应,在随后的调用中,服务器发送此“FP”cookie 的经过身份验证的新值,问题是这个新的经过身份验证的 cookie 永远不会在 android 中更新,它在 iOS 平台上运行良好,在桌面上也运行良好。
每次加载新 URL 时,我都会打印 cookie:
override fun onPageFinished(view: WebView?, url: String?) {
super.onPageFinished(view, url)
val cookies3 = CookieManager.getInstance().getCookie(url)
Log.d("Cookie", cookies3)
}
但我没有看到任何新更新的 cookie。
这也是我的 Webview 设置:
ssoWebView.settings.javaScriptEnabled = true
cookieManager.setAcceptCookie(true)
cookieManager.setAcceptThirdPartyCookies(webView, true)
问题是这个新的经过身份验证的 cookie 永远不会在 android 中更新,它在 iOS 平台上运行良好,在桌面上也运行良好。
解决方案
推荐阅读
- mysql - 尝试转储数据库时出现错误 2 或“拒绝访问”
- python - 如何翻转加载的图像精灵?游戏
- python - 应用程序不会在菜单项中放置与号(wxPython)
- assembly - 简单的 hello world 示例 MASM x 32 程序集导致错误链接 2001
- class - 如何在飞镖中动态创建类实例以分配列表
- python - 如何使用 GStreamer CLI 通过 TCP 或 UDP 将 rtsp 视频源转发到接收器?
- python - 在 sympy 中替换一个矩阵
- c# - 如何使用 csvhelper c# 从 csvfile 中解析特定值
- python - 通过固定浮点类别处理具有混合数据类型的对象列
- angular - 如何防止更改 Angular 表单字段时发生多个事件