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

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

英雄似剑 发布于 2021-11-25 字数 364 浏览 741 回复 1 原文

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.

如果你对这篇文章有疑问,欢迎到本站 社区 发帖提问或使用手Q扫描下方二维码加群参与讨论,获取更多帮助。

扫码加入群聊

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

朱染 2022-06-07 1 楼

You can set the Session timeout (minutes).

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