> localStorage
> Websql DB
>索引DB
我想知道,对于每种类型,数据存储多长时间?
如果用户在第二天进入,数据仍然会在那里?一个月后一年?
谢谢
解决方法
用户可以随时擦除他/她的本地数据,任何类型的本地存储都受到用户偏好的限制,并被认为是非常不稳定的.但是,根据Web存储规范,没有定义的到期时间:
Expiring stored data
User agents may,if so configured by the user,automatically delete stored data after a period of time.
For example,a user agent could be configured to treat third-party local storage areas as session-only storage,deleting the data once the user had closed all the browsing contexts that could access it.
This can restrict the ability of a site to track a user,as the site would then only be able to track the user across multiple sessions when he authenticates with the site itself (e.g. by making a purchase or logging in to a service).
However,this also reduces the usefulness of the API as a long-term storage mechanism. It can also put the user’s data at risk,if the user does not fully understand the implications of data expiration.