This article explains the local (client-side, browser) storage feature in HTML 5.
Since the introduction of HTML5, the technology is making an equal impact in the desktop and mobile space. It has completely changed what is possible with a Web interface. The new features are so powerful they bring Web pages closer to Apps. The new features include a plug-in-free paradigm, with the introduction of tags like <video>, semantic mark-up like <header>, new form elements like email, and client-side storage. There is a constant drive to make browserspecific incompatibilities disappear.
The need for client-side storage has been felt with the increasing use of Web for e-commerce, with the aim to enhance the user experience by storing user preferences, shopping cart items and user-session information. Cookies have served Web developers for long, but have size limitations (4 KB each) and need to be transferred from client to server. The importance of offline storage has increased with Web app development using HTML5. There are times when the user is not connected to the Internet (e.g., composing an email in an airplane using Internet web app to send later), or when data needs to be saved across sessions (e.g., a Web gaming app needs to store the session state, like the board positions for chess, so that the game can be resumed later).
With HTML5, two new objects are introduced for clientside storage. They are localstorage and sessionstorage. We will focus on localstorage in this article. New object sessionstorage is to store data for one session. Before introduction of localstorage in HTML5, developers had to choose from various vendor- or browser-specific options like Google Gears, userdata
in IE, and Local Shared Objects used in Adobe Flash Player.