android - 使浏览器 cookie 在 web View 中可用

标签 android webview android-webview session-cookies

是否可以让默认浏览器的 cookies 在 webview 中可用?我想使用 webview 进行身份验证,因为 webview 默认使用自己的 cookie 存储,我的用户必须再次输入他们的凭据,这是我真正想避免的事情。

[edit] 我忘记添加的内容:我使用 google 和 facebook 作为登录的 openid-providers,而且很可能用户已经使用该帐户登录。所以在网络浏览器中,他们不需要输入他们的凭据,但在 WebView 中他们是。我真的认为在 WebView 中询问 google 或 facebook 密码是不好的做法。

最佳答案

Is it possible to make the cookies of the default browser available in a webview?

不,对不起。

I want to use a webview for authentification and since the webview uses its own cookie store by default, my users would have to enter their credetials a second time, and that is something I really would like to avoid.

然后要么:

  • 为整个体验使用 WebView,或者
  • 在整个体验中使用用户选择的浏览器,或者
  • 使用 cookie 以外的东西进行 session 跟踪(例如,URL 中的 jsession 值)

关于android - 使浏览器 cookie 在 web View 中可用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10674876/

相关文章:

java - Android 启动画面到 Activity

android - 如何区分android web View 和浏览器 View ?

javascript - Android WebView + loadUrl with javascript + onPageFinished = lag

android - 如何从 webview 打开的网页关闭 android webview?

android webview 内容不可选择

java - Java中通过子目录进行文件名过滤

android - 溢出菜单和子菜单中的色调菜单图标

java - Android Studio 无法导入项目 : java. util.ArrayList 无法转换为 java.util.Map

java - 如何解决 "glUtilsParamSize"问题

android - Nestedscrollview/Scrollview 中的 Webview 缺少内容