View Full Version : Local state management vs Server session management

6 Aug 2009, 6:04 AM
I'm still feeling confuse of session state management in javascript application.

As I'm moved from the traditional server side programming to the Ajax world, in my point of view, the data carried between the pageload can now be handled in the client side by saving it in the memory, so...can I say that the server side session could be replaced by this way of implementation?

I know there may have some security issues on it, but I think it could be handled by the server side.

Anyone can give me some suggestions? thanks

6 Aug 2009, 2:44 PM
Client-side state management:

In some scenarios, it reduces network traffic and/or simplifies your client application, because you are not doing roundtrips
Generally, you can store less data than if you used the server side approach
You have less control over the integrity and consistency of the state, due to the environment where you're saving it (the client)
State is confined to a computer, cannot follow the userServer-side:

Needs roundtrips to the server and the complexities that come with those
You have more control: what, where, how long you keep it
Can follow the user accross system boundariesYou have to decide what's better for your situation.

6 Aug 2009, 3:14 PM
MiamiCoder is spot on.

A word of warning with client side state management. We turned on the standard Ext cookie state manager on a panel we have that contains 7 tabs with each tab containing a grid and the cookie was over 14K in size and blew the header limits on the web server. Ouch!

We now run with our own http state provider, based on the Ext one, for that reason alone.