What are the modes of storing ASP.NET session. What are the ways to maintain state in Asp.Net ?
ASP.NET session and Maintain State in Asp.Net
Hi
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
SenthilkumarPosted May 2, 2012, 11:53 PM
1) InProc
2) OutProc
3) Sql Server
InProc is default session state management, it will store the session in the processor memory (IIS). The aspnet_wp.exe will have the store mechanism to maintain the state of the session. when every you restart the IIS the session will be expired.
OutProc is another session state mode, it will store the session on the aspnet_state.exe, it can be local or remote where multiple application can share the same session.
SqlServer is store the session on the database table, where it needs serialization and deserialization every retrieve and store.
Session can be maintained in client and server
1) Client:
- Cookies
- Hidden Fields
- Query string
- View state
- Control state
2) Server:
- Session state
- Application state
- Database
Hope this will help you.
MuthuMari MPosted May 2, 2012, 12:35 PM
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,
1.server-side state management
2.Client side state management
pls refer this url for more info:
http://msdn.microsoft.com/en-us/magazine/cc300437.aspx
http://msdn.microsoft.com/en-us/library/z1hkazw7.aspx
Thanks.