How should I configure Session State in my Web application?

You can configure session state by modifying the <sessionstate> element in your web.config file. There are several options you can set in this section.

mode (required)

cookieless (optional)

timeout (optional)

stateConnectionString (optional)

sqlConnectionString (optional)

If you do not specify a <sessionState> section in your web.config, your application will use the defaults defined on the server. Below you can see the default configuration on the shared hosting servers:

<sessionState mode= "StateServer"stateConnectionString="tcpip=127.0.0.1:42424" cookieless="false" timeout="20" />