Have you ever wondered if there is an alternative for Cookies?
You should, because there are limitation and downsides in using Cookies on your website that massively use this feature.
- Cookies has limited size on most browsers
- Cookies is transfer to server every page load
- If you overload the size of the Cookies it will also eat up the space of session and might remove it
Introducing jStorage, a jQuery way of saving your data to the local client and I quote
jStorage is a cross-browser key-value store database to store data locally in the browser – jStorage supports all major browsers, both in desktop (yes – even Internet Explorer 6) and in mobile.
Yes it even support IE 6!
So how to use it in an easy way?
- Include the following references to your project
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> <script src="https://raw.github.com/andris9/jStorage/master/jstorage.js"></script>
- Use $.jStorage.set(key, value) to save a value
- Use $.jStorage.get(key, “default value”) to get a value
And thats it you are now using jStorage.
Reference : http://www.jstorage.info/