LocalStorage extends the 4K limit on cookies, the only difference from sessionStorage.

LocalStorage is a persistent storage,

SessionStorage when the session ends, the sessionStorage key/value pairs will be cleared.

1. The store

window.localStorage.setItem(“user”,JSON.stringify(res))

2. The values:

var user = JSON.parse(localStorage.getItem(‘user’))

3. Delete a value:

window.localStorage.removeItem(‘user.name’)

4.. Delete all

window.localStorage.clear()