HTML5 Local Storage Web Developer, London

HTML5 Local Storage

Local Storage was added into HTML5 to make greater browser memory available to Web Developers.

Traditional browser cookies have been around for many years but a larger capacity was needed to cope with today’s web development requirements, and HTML5 aimed to make this a specified standard.

Local Storage enjoys a relatively solid support from browsers, including Internet Explorer 8, and there are also some addons available to take care of legacy browsers for those needing to cover them as well. It maybe wise to take advantage of Modernizr to quickly calculate each browser’s coverage of Local Storage, particularly when it is used to perform a critical action in your website. Javascript users can write their own scripts to detect Local Storage support, but it is far easier to use Modernizr’s in-built tools, particularly if you already are using this plug-in in your website anyway.

Local Storage is set and amended through Javascript and you can also use sessionStorage instead if you only want the memory to continue until the broswer is closed.

Simply amend the localStorage object with in Javascript to use this HTML5 feature. There are methods of sestItem() and getItem() for standard ways of editing the localStorage, but you can also do it directly.