Question - What do you understand by HTML5 Web Storage? Is it any better than Cookies?
Answer -
Prior to HTML5, web pages were able to store data locally within a browser using cookies. The HTML5 introduces Web Storage that allows a webpage to do the same as that of the cookies. Web Storage, however, is faster and more secure than cookies.
The HTML5 Web Storage is faster because the data isn't included with every server request. Instead, it is used when asked for. A web page can only access the data stored by itself, which is stored in name/value pairs
Another important distinction between the HTML5 Web Storage and Cookies is that:
- Web Storage never transfers the data to the server, and
- When compared to cookies, the storage limit for the HTML5 Web Storage is much larger, at least 5MB, and at max 10MB.