Can you explain how HTML5 local storage works?
I know that HTML has filing for the application. But how does that local storage work?
HTML5 lets web pages store data locally in the user’s browser.
Kind of like cookies.
I don’t see much benefit to doing that.
Web storage is also faster, since it stores the information in the browser where HTML code can access it regularly.
I’m not seeing notices from my browser it is downloading tons of data.
The data is stored as name – value pairs. The file size is much larger, up to five megabytes.
That’s a lot of information that could be used against me or used to infect my machine.
Security is greater than with cookies because the locally stored information is never transferred to the server; it stays on the user’s machine.
There’s still the security concern of some other webpage stealing the megabytes of data stored on my browser.
The web page can only access data stored by that page, so the data can’t be accessed by other apps or even other web pages that use local storage.
Where is the information stored, then?
Web storage in HTML5 is either in window.localstorage for data without an expiration date and code.sessionstorage for data that will be deleted when the session ends.
Why haven’t I heard of this before?
It’s new. It doesn’t work on IE seven or earlier or older versions of Firefox.
It is amazing anything works with IE 7 at all.
A lot of people who never upgraded from Windows XP still are. Heck, several million people still use AOL.