Cross-Browser Client-Side Storage of User Data - ΩJr. Software Articles and Products

This information lives on a web page hosted at the following web address: 'https://omegajunior.globat.com/code/'.

In the old days, we used cookies. Then along came MS Internet Explorer 5, introducing the userData behavior. Now we have HTML5 with localStorage. Why should we use it? Why shouldn't we use it? And can it be used across browsers?

A.E.Veltstra
Monday, May 17, 2010

Why should we use it?

To avoid having to load as much data from a server. Loading data across network connections seems a bottleneck in most web applications we write. While AJAX-like solutions provide the ability to load data in real-time, the page load lag can turn them into ANNOYJAX rather quickly. And if we can assume safely, that the data isn't going to change with every page refresh, we're better off caching the data on the client's computer.


Why shouldn't we use it?

The data is stored without encryption. Privacy-sensitive data should not be cached when we don't know whether or not the client is using a private or a public computer. Plus, some people like to increase security levels and prevent the access to client-side storage, and others browse the net using devices that lack the ability to store anything.


Can it be used across browsers?

All modern browsers that we tested support these methods, though in varying degree:



How can we use it across browsers?

Simple:


Obviously this deserves a place in a library. And we have done exactly that: added this to our own free cross-browser zjrJS framework, the newest version of which should be making its way into our web sites shortly.

Need problem solving?

Talk to me. Let's meet for coffee or over lunch. Mail me at “omegajunior at protonmail dot com”.