Of course everyone likes sessions. There are great rewards if you store some information on users machine and have the ability to read it and write it again and again without user intervention.
Most of the times cookies are sufficient enough. And since the cookie are passed in on every request to the domain which set the cookie in the first place, that information is also available to the server.
Some times that’s not enough and you want to store data which is too great to be stuffed in the cookie. In majority of the cases you would then use the session approach on the server, where the server keeps a hash map for each session id with the value of the data you want to store. Which is nice and dandy and probably the best way to do this.
But there are times where you are doing many client side operations where you don’t need the server to have the large data at all times. You may have needs to store a lot of data on client and pass in only chunks when you need it. If what I say doesn’t makes sense, think of this example. Lets say you are a site which requires no authentication, and you want to save what user has done or places he/she has been to since they first started using this site. So you can then display them a list of bookmarks or suggest them some other useful information. You can do this with cookies and just set a cookie every time they enter a page. But over couple of clicks or submit forms thru you will accumulate a lot of data and it wont fit in a cookie.
So with all that said, if you ever find your self in the similar position, there is a alternative to the cookie called “AMASS” or AJAX MAssive Storage System. Basically it’s a way to store up to 100K data on clients machine without them knowing about it. If the data is larger then 100K then the user gets an alert saying someone is trying to store data over 100K. How does it work you may ask, in essence it’s a flash file with ActionScript (flash script) 2 JavaScript API, which is what allows the flash file to store data on the user’s machine. Of course to use this functionality flash plug-in is required to be installed in the browser. Which if you look at statistics is 90% of the browsers surfing the web.
Cick here to read more on AMASS api and download.
When you use it, its simply a javascript file and few functions to set and get the data.



Add A Comment