Qus:    What are the different Session state management options available in ASP.NET?
Oct 17, 2020 08:30 2 Answers Views: 802 SAI
Prev Next
Answers (2)
PADMAKEECHU Oct 19, 2020 02:35
Answer:   1. In-Process
2. Out-of-Process.
In-Process stores the session in memory on the web server.
Out-of-Process Session state management stores data in an external server. The external server may be either a SQL Server or a State Server. All objects stored in session are required to be serializable for Out-of-Process state management.

PARTH Oct 19, 2020 04:22
Answer:   Four options are available -

1) OFF : If we do not want to use sessions in our application, then we can set the mode as "OFF".
2) InProc : This is the default mode which is used in ASP.NET to store session variables. InProc mode basically stores the session value in the process in which the ASP.NET application is running. Since it is stored in the same process, it provides high performance as compared to other modes.
3) State Server : If we use this mode, then a separate Windows Service which runs in a different process stores the Session. It basically isolates the Session from the ASP.NET running process. It provides less performance as compared to the InProc mode.
4) SQL Server : This mode stores the Session in SQL Server instead of the server's memory. If our application is stored on multiple server machines, then it becomes difficult to use the "InProc" mode since the request can go to any server for processing. So if we want to use sessions in such cases, then we can store the Session in SQL Server so that it becomes centralized and can be accessed by any server during the request process. It is the most secure way of storing Sessions but gives the lowest performance for an application.

Post Your Answer
Guest User

Not sure what course is right for you?

Choose the right course for you.
Get the help of our experts and find a course that best suits your needs.

Let`s Connect