Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What can you use HTML5's local storage for? [closed]

I was wondering what are some of the most creative and useful use cases of HTML5's local storage capabilities.

Have you ever encountered any website that uses that feature in a cool way?

In other words, what are some of the examples of places where storing user data in a browser indefinitely can be used?

Any ideas are appreciated

like image 341
Yasser1984 Avatar asked Sep 22 '11 21:09

Yasser1984


People also ask

What should local storage be used for?

Local storage provides at least 5MB of data storage across all major web browsers, which is a heck of a lot more than the 4KB (maximum size) that you can store in a cookie. This makes local storage particularly useful if you want to cache some application data in the browser for later usage.

What can you store in local storage?

LocalStorage is a key/value datastore that's available on a user's browser. Like cookies, LocalStorage can only store string data for its keys and values. The datastore is only accessible to JavaScript within that domain.

Does local storage persist when browser is closed?

The main features of localStorage are: Shared between all tabs and windows from the same origin. The data does not expire. It remains after the browser restart and even OS reboot.

Can you use localStorage in incognito?

Local Storage data stored on normal browsing sessions will not be available when you open a browser in private browsing or in Incognito mode. Local Storage data will not get cleared even if you close the browser.


2 Answers

one of the most practical reasons to use it is so that the user has some data pre populated when they start their app, i.e. the UI can show data right away, and then sync up with the server behind the scenes. Combined with an html5 manifest, this is quite powerful juju.

It's also useful for RIAs when the app wants to save data intermittently without going to the server. For example, an RIA word processor, you can store the document to local storage....

like image 116
hvgotcodes Avatar answered Sep 20 '22 15:09

hvgotcodes


It's helpful to store your applications data while the computer is offline. Then you can synchronize the data when the computer is online again.

like image 23
Jonas Avatar answered Sep 20 '22 15:09

Jonas