With new Html 5 there are 3 main ways to store data in your browser:
I wanted to know, for each of the types, for how long data is stored? If the user enters the day after, the data will still be there? after one month? and one year?
Thanks
LocalStorage has no expiration time, Data in the LocalStorage persist till the user manually delete it. This is the only difference between LocalStorage and SessionStorage.
HTML web storage provides two objects for storing data on the client: window.localStorage - stores data with no expiration date. window.sessionStorage - stores data for one session (data is lost when the browser tab is closed)
It is limited to about 5MB and can contain only strings. LocalStorage is not accessible from web workers or service workers. Cookies have their uses, but should not be used for storage.
In HTML5 there are two types of web storage API. localStorage: It is used to store data on the client-side.
The most correct answer to this question is: You don't know.
The user could wipe his/her local data at any time, and any type of local storage is subject to user preferences and to be considered extremely volatile. However, there is no defined expiration time, according to Web Storage specifications:
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.
Source: http://dev.w3.org/html5/webstorage/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With