ASP.NET SESSION RELATED INTERVIEW QUESTIONS ANSWERS SET-2
Hey .net developers this is the second set of Asp.net session(state management) questions answers serices. These are most inportent questions answers asked by interviewers. This set also containing 10 questions. (click here for SET-1 http://a1tutorials.blogspot.com/2014/08/aspnet-security-interview-questions-and.html

ASP.NET SESSION(STATE MANAGEMENT) QUESTIONS SET - 2

11).What are the session modes available in asp.net?

Ans:
Off
InProc
StateServer(Out-Proc)
SQLServer
Custom

12).What is the default session modes in asp.net?
Ans: InProc

13).What are the disadvantages of using InProc session mode?
Ans: Its stores session information in the current Application Domain.
So it will lose data if we restart the server.

14).Session_End() event is supported by which session mode only?
Ans: Session_End() event is supported by InProc mode only.

15).What do you understand by StateServer(Out-Proc) mode?
Ans: StateServer session mode is also called Out-Proc session mode. StateServer uses a stand-alone Windows Service which is independent of IIS and can also be run on a separate server. This session state is totally managed by aspnet_state.exe. This server may run on the same system, but it's outside of the main application domain where your web application is running. This means if you restart your ASP.NET process, your session data will still be alive.

16).Under StateServer(Out-Proc) mode the session state is managed by?
Ans: aspnet_state.exe

17).What are the advantages and disadvantages of StateServer(Out-Proc) Session mode?
Ans: Advantages:
It keeps data separate from IIS so any issues with IIS will not hamper session data.
It is useful in web farm and web garden scenarios.
Disadvantages:
Process is slow due to serialization and de-serialization.
State Server always needs to be up and running.

18).Under SQLServer Session Mode where the session data store?
Ans: In SQLServersession mode, session data is serialized and stored in A SQL Server database.

19).What is the big disadvantage of SqlServer Session mode?
Ans: The main disadvantage of SqlServer Session mode storage method is the overhead related with data serialization and de-serialization.

20).What are the advantages and disadvantages of SqlServer Session mode?
Ans: Advantages:
Session data not affected if we restart IIS.
The most reliable and secure session management.
It keeps data located centrally, is easily accessible from other applications.
Very useful in web farms and web garden scenarios.
Disadvantages:
Processing is very slow in nature.
Object serialization and de-serialization creates overhead for the application.
As the session data is handled in a different server, we have to take care of SQL Server. It should be always up and running.