Best way for cross platform client storage?

433 Views Asked by At

I need a cross platform way to store data on the client without using cookies, because a token is being saved clientside which should not be sent to the server on each request.

Requirements

  • old browser (IE6+) have to be supported
  • has to be working on mobile devices (in webviews) as well
2

There are 2 best solutions below

1
On

You can't store data on the client without cookies. You could pass the session ID in the URL. As an example with PHP: http://php.net/manual/en/session.idpassing.php but that's the best you can get.

I don't see a problem supporting IE6. Using 'progressive enhancement' you can provide a very basic site to older mobiles, IE6/7 and other crap. Then, layer on the more advanced stuff to the devices that can handle it. I don't test in IE6, but I'm 99% my sites work in it.

0
On

If you use JayData ItemStore API, there is a fallback mechanism while detecting the available local storage technologies. The priority order is WebSQL, IndexedDB, HTML5 localStorage. The bad piece of news that you need a HTML5 browser.

Disclaimer: I'm member of the development team of the open-source JayData library