Hi I am using asp.net 2.0 and I want admin session variable timeout for 1 hour.
Is it possible? and How?
I am using windows authentication.
Hi I am using asp.net 2.0 and I want admin session variable timeout for 1 hour.
Is it possible? and How?
I am using windows authentication.
You can set the session timeout globally in web.config:
<configuration>
<system.web>
<sessionState
mode="InProc"
cookieless="true"
timeout="30" />
</system.web>
</configuration>
And you can programmatically override that setting in your code (e.g. for the admin's session only), by setting Session.Timeout, e.g:
// set the current session's timeout to 60 minutes
// if the current user is an admin
if (currentUserIsAdmin)
Session.Timeout = 60;
Have a look at this MSDN page for details.