Tuesday, March 15, 2011

ASP.NET Is it possible to differentiate session length from user?

In asp.net session length, can it be of a different length depending on the type of user logging in? I want admin users to timeout after 3 hours, but standard users to timeout after 30mins, because staff in the office often have multiple windows open, and requested a longer session length. I'm a little sceptical about lengthening it for the outside world.

From stackoverflow
  • You can set the Session timeout (minutes).

     if (User.IsInRole("Admin"))
          Session.Timeout = 3 * 60;
    

0 comments:

Post a Comment