Android设备重启时,WebView中的Cookie、本地存储值会被删除吗?

发布于 2025-01-03 01:39:11 字数 271 浏览 1 评论 0原文

我正在开发基于 Webview 的 Android 应用程序,在我的应用程序中将一些值存储到 cookie 和 HTML5 本地存储中。我想知道 cookie 和本地存储对于下面提到的 2 个场景有什么不同的行为,因为我没有 Android 设备。

  1. 设备重启时Cookie、本地存储值是否被删除?
  2. 当设备应用程序崩溃时,Cookie、本地存储值是否被删除?
  3. 进入后台堆栈后恢复时Cookie、本地存储值是否被删除?

提前致谢 〜斯里

I m developing Webview based Android application, In my application storing some values into cookies and HTML5 local storage. I would like to know what is the different behavior for cookie and local storage for below mentioned 2 scenario's,since i don't have Android device with me.

  1. Whether Cookie,Local storage values are deleted when device is restarted?
  2. Whether Cookie,Local storage values are deleted when device is app crashed?
  3. Whether Cookie,Local storage values are deleted when resume back after enters into background stack?

Thanks in advance
~sri

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

惟欲睡 2025-01-10 01:39:11
  1. cookie 的生命周期取决于您如何定义 cookie。如果您不指定 cookie 的生命周期,它将在浏览器关闭后立即被删除。如果您这样做,cookie 应该能够在重新启动和崩溃后幸存下来。
  2. 本地存储由您维护,它也将在您的所有情况下幸存下来。这是很好的概述
  1. Lifetime of cookie depends on how you defined the cookie. If you don't specify cookie lifespan it will be deleted as soon as browser is closed. If you do cookies should survive restarts and crashes
  2. Local storage is for you to maintain, it will survive all your scenarios as well. Here's good overview
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文