Log in

View Full Version : What is the lifetime of local storage?



dennis123
09-21-2017, 06:22 AM
What is the lifetime of local storage?

rohit
09-22-2017, 05:22 AM
According to John Resig, it's not possible to specify expiration. It's completely up to the user.

24x7servermanag
09-22-2017, 08:29 AM
That's correct! It's upto the user. You can define that. User need to create the timestamp explicitly for the local storage. Because there is no use of storing the too old information. When you define the timestamp value explicitly then you will be asked for whether to flush the storage or not.

Nirala
09-25-2017, 03:17 AM
There is no time limit for local storage, it doesn't have the expiration limit. User can set ut Manually
To know more about you can visit the following
Difference Between Cookies, Local Storage & Session Storage (https://www.webdesigninghouse.com/blogs/difference-between-cookies-local-storage-session-storage)

salman gee
10-09-2017, 06:56 PM
Browsers that implement the “Web Storage” draft specification define two properties on the Window object: localStorage and sessionStorage. Both properties refer to a Storage object—a persistent associative array that maps string keys to string values. Storage objects work much like regular JavaScript objects: simply set a property of the object to a string, and the browser will store that string for you. The difference between localStorage and sessionStorage has to do with lifetime and scope: how long the data is saved for and who the data is accessible to.

Storage lifetime and scope are explained in more detail below. First, however, let’s look at some examples. The following code uses localStorage, but it would also work with sessionStorage: