It is an alternative to cookies and it is better than cookies. With the help of localstorage we can store data locally inside user browser. It is more secure as compared to cookies. It can be modified easily using setItem() and getItem() method.
Locastorage Objects:
window.localStorage
window.sessionStorage
localStorage Object:
It store user data with no expiration date means user data will persist even when browser has been closed.
sessionStorage Object:
It is similar to localstorage except that it stores the data for only one session. The data gets deleted once user closes the specific browser tab.
0 Comment(s)