HTML5 There are two types of web storage Api
- Local Storage
- session Storage
Local Storage:
- Used to store data on client side.
- It has no expiration time.
- Data in the localStorage exists always till the user manually delets it.
Ex:
Setting Local Storage:
LocalStorage.setItem(“Key”,”Value”);
Getting Local Storage:
LocalStorage.getItem(“Key”);
Session Storage:
- Used to store data on client side.
- Data in the Session Storage till exists, current tab is open.
- If we close current tab our data will erase automatically from the session Storage.
Ex:
Setting Session Storage:
SessionStorage.setItem(“Key”,”Value”);
Getting Session Storage:
SessionStorage.getItem(“Key”);


