State management is a critical thing to master when coming to Web world from a desktop application perspective.
- Session is used to store per-user information for the current Web session on the server. It supports using a database server as the back-end store.
- Cookie should be used to store per-user information for the current Web session or persistent information on the client, therefore client has control over the contents of a cookie.
- Cache object is shared between users in a single application. Its primary purpose is to cache data from a data store and should not be used as a primary storage. It supports automatic invalidation features.
- Application object is shared between users to store application-wide state and should be used accordingly.
No comments:
Post a Comment