What are Session State Modes depending on various storage options for session data in ASP.NET

sam
sam
154 Points
67 Posts

What are Session State Modes depending on various storage options for session data in ASP.NET?

Views: 9042
Total Answered: 1
Total Marked As Answer: 0
Posted On: 23-Dec-2015 09:26

Share:   fb twitter linkedin
Answers
Smith
Smith
Moderator
738 Points
154 Posts
         

Hi sam,

There are different Session State Modes depending on various storage options for session data in ASP.NET

  • InProc: It is default mode. It has application scope. It stores session state in memory on the Web server. It is the only state mode that supports the Session_OnEnd event.
  • StateServer: It stores session state in a separate process called the ASP.NET state service. State Server mode ensures that session state is preserved if the Web application is restarted
  • SQL Server: It stores session state in a SQL Server database. It ensures that session state is preserved if the Web application is restarted.
  • Custom: It specifies that you want to store session state data using a custom session state store provider.
  • Off

You can change the mode into the web.config file as:

<configuration>
<system.web>
<sessionState mode="InProc"
          cookieless="false"
           timeout="20"/>
</system.web>
</configuration>
Posted On: 24-Dec-2015 00:11
 Log In to Chat