Normally You will configure the session in Web.Config or in code behind. In web config session state is configured with the the element <Sessionstate>. In that there are lot of attribute are there like Mode, Timeout, StateConnectionString, CustomProvider, cookieless, cookieName,allowCustomSqlDatabase,useHostingIdentity etc…
ASP.NET session state supports several storage options for session variables and identified
as session-state Mode.
The default sessionMode=’InProc’.
a) InProc mode:- which stores session state in memory on the Web server. This is the default.
Note:- If you enable Web-garden mode by setting the webGarden attribute to true in the processModel element of the application’s Web.config file, do not use InProcsession state mode. If you do, data loss can occur if different requests for the same session are served by different worker processes.
b) StateServer mode:- which stores session state in a process, referred to as the ASP.NET state service, that is separate from the ASP.NET worker process or IIS application pool. Using this mode ensures that session state is preserved if the Web application is restarted and also makes session state available to multiple Web servers in a Web farm
c) SQLServer mode:- stores session state in a SQL Server database. This ensures that session state is preserved if the Web application is restarted and also makes session state available to multiple Web servers in a Web farm. To use SQLServer mode, you must first be sure the ASP.NET session state database is installed on SQL Server. You can install the ASP.NET session state database using the Aspnet_regsql.exe tool
d) Custom mode:- which enables you to specify a custom storage provider.
e) Off mode:- which disables session state.
More about:- SesionMode Clickhere