What are the advantages and disadvantages of using Session State?

 Posted by Tripati_tutu on 10/30/2010 | Category: ASP.NET Interview questions | Views: 24208 | Points: 40

The advantages of using session state are:

• It is easy to implement and is just similar to using View State.
• Accessing of data is very fast as it stores session data in memory object of the current application domain.
• It ensures platform scalability and it works in the multi-process configuration.
• Also it ensures data durability, since the session state retains data even if ASP.NET work process restarts (in outproc session).

The disadvantages of using session state are:

• As the session state data is stored in server memory, it is not advisable to use session state when you are working with large sum of data.
• With the use of Session state, it will affect the performance of memory, because session state variable stays in memory until you destroy the state.
• If the worker Process or application domain recycles all session data will be lost.
• We can't use it in web Garden scenarios and is not suitable for web farm scenarios also.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response