InProc Session State
InProc session mode indicates that session state is stored locally, means that with InProc session state mode is
store objects in the AppDomain of the Web application.Because of this the session state is lost when IIS (Internet Information System) restarts.
Generally, the AppDomain is restarted based on several factors like memoryLimit attribute
settings in the section of the configuration file, modifiying Global.asax or the Web.config file etc.
We can use StateServer or SqlServer session state mode for overcome these issues and here session state is not stored in the AppDomain of the Web application.
OutProc Session State
In OutProc Session ,Sessin State is stored In the StateServer and SqlServer modes not in the AppDomain of the Web application.
StateServer: it uses a stand-alone Microsoft Windows service to store session variable, so this service
is independent of IIS, it can run on a separate server.
You can use this mode for a load-balancing solution because multiple Web servers can share session variables.
Although session variables are not lost if you restart IIS, performance is impacted when you cross process boundaries.
SqlServer: SqlServer mode also enables you to utilize a state store that is located out of the IIS process and that can be
located on the local computer or a remote server. For persistence of session information, you can use SqlServer mode
SqlServer mode is similar to out-of-process mode, except that the session data is maintained in a SQL Server.