HTML5 Web Storage API
HTML5 web storage is modeled after cookie concept in prior versions of HTML. Cookie is designed to pass data between server and user computer. This data is usually used to personalize website and contained user preferences as well as other user oriented information. For example, Shopping Sites use cookies to track items placed in the shopping cart.
Cookies are useful in many ways, but they are not perfect. There are very well document drawbacks in using cookies. First of all, cookies are limited in size. You can only store 4KB of data in the cookie. Another issue with the cookie is in multiple transmissions required for every request made to the server hosting your HTML files. As a result, additional bandwidth is consumed as well as complexity of handling this passage forth and back exists.
HTML5 provides an alternative to cookies in the form of HTML5 web storage. It does the same thing cookies do, but in more efficient ways. HTML5 web storage allows developer to store JavaScript objects. It provides flexibility when it comes to lifespan of the data in the HTML5 web storage. You can set value that determines how long your data will live. For example, sessionStrorage and localStorage allow you to instruct HTML5 to preserve values in web storage across page loads or across browser restarts. HTML5 web storage has capability to store Megabytes of data versus just 4Kb with cookies.
There are other benefits that HTML5 web storage provides which may be very specific to your needs.