Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
MuthuMari MRank #5,738 · 288 reputationPosted Apr 4, 2012, 3:45 AM EDT
ASP.NET Session state is nothing but, it provides a place to store values that will persist across page requests. Values stored in Session are stored on the server and will remain in memory until they are explicitly removed or until the Session expires.
InProc : - Session state is stored in memory space of ASP.NET worker process.
( I.e. Aspnet_wp.exe)
This is the default setting, if the IIS reboots or the windows application restarts then the session state is lost.
State Server :-
Session state is stored outside ASP.NET worker process and is managed by Windows service. Location of this service is specified by stateConnectionString attribute.
Session state is serialized & stored in a separate process ie aspnet_state.exe.(session state stored in a separate computer)
SQLServer :-
Session state is serialized & stored in a Sql server DB.
Session state is stored outside ASP.NET worker process in SQL Server database. Location of this database is represented by sqlConnectionString attribute.
Other ways to maintain state
Hiddenfields,query string, viewstate etc,
Thanks.
SenthilkumarRank #387 · 6.5K reputationPosted Apr 4, 2012, 6:44 AM EDT
1) Session state is server side state management mechanism in asp.net and data is persist across the post backs.
2) It can be shared across the web pages. It is user basis. Every logged in user will have the separate session.
3) There are three ways to hold the session value in the application. They are InProc, OutProc, Sql server
4) Inproc is most prefer method, which stores the session state in the asp.net worker processor. It is nothing but the iis processor (aspnet_wp.exe). When you restarts the IIS, the session will be expired.
5) OutProc will maintain the session state in the state server. It can be on the same machine or remote machine. Session will store on aspnet_state.exe. Many application can store the session on the state server and many number of application can share same session.
6) Sql server mode is stored the session state in the sql server database and it will make network traffic. It needs encryption and decryption every time while storing in sql server.