gpt4 book ai didi

javascript - 浏览器是否将 localStorage 视为 cookie

转载 作者:搜寻专家 更新时间:2023-10-31 08:27:42 26 4
gpt4 key购买 nike

我正在用 Javascript 制作一个小的 HTML 页面。它不需要服务器端,但我需要存储这个人所做的事情,所以我正在使用 localStorage。( list )

如今,浏览器可以选择不存储 cookie,并且网站会警告用户是否使用 cookie。

所以我的问题是:

1:我需要警告用户数据正在存储,但只是在客户端?

2:浏览器将localStorage和sessionSotrage视为一种cookie?我的意思是,当用户选择始终删除 cookie 或将其视为一种威胁时,不要保存数据。

最佳答案

I need to warn the user that data is being stored, but just in the client side?

这取决于您关注的具体立法。例如在英国,The Privacy and Electronic Communications (EC Directive) Regulations 2003 的措辞说:

, a person shall not use an electronic communications network to store information, or to gain access to information stored, in the terminal equipment of a subscriber or user unless the requirements of paragraph (2) are met.

虽然它通常被称为“Cookie 法”,但它绝对不仅仅适用于 cookie。


Browsers considers localStorage and sessionSotrage a kind of a cookie?

没有

I mean, do not save the data when the user select to always erase the cookies

删除它们时,Chrome 会将本地存储与 Cookie 捆绑在一起。但是,对所有浏览器允许用户确定何时删除 cookie 和本地存储的所有情况进行全面调查有点超出 SO 问题的典型范围。

Chrome preferences

关于javascript - 浏览器是否将 localStorage 视为 cookie,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31566530/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com