How do u configure session mode in web.config file?

Using <sessionState> tag

This tag can be used to specify, were we are storing the session. This can be specified in the mode attribute. Supported values mode are Off, InProc, StateServer and SqlServer. InProc indicates that, session states is stored locally. StateServer indicates that session state is stored on a remote server and sqlserver can be used to indicate that the session state is stored on a sql server.
We also have the choice to use cookies to store the sessions. This can be set using the attribute cookieless. Session timeout can be specified using the attribute called timeout. By default, the session timeout is 20 minutes (same as classic ASP).

<configuration>
<system.web>
<sessionState mode="Inproc" cookieless="true" timeout="20">
</sessionState>
</system.web>
</configuration>
Tagged . Bookmark the permalink.

Leave a Reply