Introduction
In HTML5 Web Storage is a new API for storing data on the client-side. There are two types of Web Storage.
- Local Storage: stores data with no expiration date. Local Storage is kept even between browser sessions. This means data is still available when the browser is closed and reopened and also instantly between tabs and windows.
- Session Storage: stores data for one session. Session Storage is only available within the browser tab or window session. It's designed to store data in a single web page session.
How to Create Local Storage
How to Create Session Storage
How to Delete Storage
Web Storage vs. Cookies



| Web Storage | Cookies |
| Data storage limitation is of 5MB to 10 MB per domain.
|
Storage limit of 4kb. Most browsers allow 30 to 50 cookies, so if you exceed the 4 KB limit of one cookie you could create another one. |
| The data is not included with every server request but used ONLY when asked for. | Cookies always sent with every HTTP request (usually even for images) resulting in more data being sent over the network. |
Note: Web Storage data is, in both cases, not available between differing browsers. For example, storage objects created in Firefox cannot be accessed in Internet Explorer, exactly like cookies.
Conclusion
In this article, we studied Web Storage in HTML5.

Prasanna MuraliPosted May 20, 2016, 11:21 AM
Nice one....
Bhuvanesh MohankumarPosted Apr 30, 2016, 3:10 PM
Good one...
Gagan SikriPosted Jan 20, 2016, 2:21 AM
Nice article with great explanation!
Santhakumar MunuswamyPosted Jan 19, 2016, 3:16 PM
Thanks for nice article. Keep it up
Rupesh KahanePosted Jan 19, 2016, 10:48 AM
Nice share
Mohammed IbrahimPosted Jan 19, 2016, 9:00 AM
nice
Ranjit PowarPosted Jan 19, 2016, 3:01 AM
Good
Ranjit PowarPosted Jan 19, 2016, 3:01 AM
Good
Humayun Kabir MamunPosted Jan 18, 2016, 10:41 PM
Nice...
Pankaj Kumar ChoudharyPosted Jan 18, 2016, 7:29 PM
+5 for explanation ..........
Ehsan SajjadPosted Jan 18, 2016, 3:52 PM
good effort