Session in Dot Net

Web is Stateless, which means a new instance of the web page class is re-created each time the page is posted to the server. As we all know HTTP is a stateless protocol, it can’t hold the client information on page. If user inserts some information, and move to the next page, that data will be lost and user would not able to retrieve the information. So what we need? we need to store information. Session provides that facility to store information on server memory. It can support any type of object to store along with our custom object. For every client Session data store separately, means session data is stored as per client basis.

State Management using session is one of the asp.net best features, because it is secure, transparent from users and we can store any kind of object with in it. Along with advantages, some times session can causes performance issue for heavy traffic sites because its stored on server memory and clients read data from the server itself. Now lets have a look at the advantages and disadvantages of using session in our web application.

Advantages :

It helps to maintain user states and data to all over the application.
It can easily be implemented and we can store any kind of object.
Stores every client data separately.
Session is secure and transparent from user.

Disadvantages :

Performance overhead in case of large volume of user, because of session data stored in server memory.
Overhead involved in serializing and De-Serializing session Data. because In case of StateServer and SQLServer session mode we need to serialize the object before store.

You can leave a response, or trackback from your own site.

Send Inquiry Message With Your Contact Details