Local state management vs Server session management
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
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 user
You have to decide what's better for your situation.
- 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 boundaries
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.