HTML5 Web Storage
With HTML5 web storage, websites can store data on a user’s local computer.
The Advantages of Web Storage
– More secure
– Stores a larger amount of data
– Stored data is not sent with every server request
Types of Web Storage Objects
There are two types of web storage objects:
Local vs. Session
– Session Storage is destroyed once the user closes the browser
– Local Storage stores data with no expiration date
Working with Values
The syntax for web storage for both local and session storage is very simple and similar.
The data is stored as key/value pairs.
Storing a Value:
Getting a Value:
Removing a Value:
Removing All Values: