digiguru
digiguru

Reputation: 12829

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.

Upvotes: 1

Views: 279

Answers (1)

Dead account
Dead account

Reputation: 19960

You can set the Session timeout (minutes).

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

Upvotes: 2

Related Questions