Asp.net session timeout

how to set session timeout in asp.net?

via code and via web.config (I hear you can do this here).

thank

0


a source to share


2 answers


Yes In your web.config

<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="30"
/>

      



Maintains session state for 30 minutes

+3


a source


To do this via web.config:

Modify the timeout attribute of the sessionState element.

<sessionState timeout="30" />

      



Do it in code:

Session.Timeout = 20;

      

Easy peasy. :)

+1


a source







All Articles