问题描述
如何从其他Web配置文件增加或减少会话超时。在我的schenario中,我必须为所有用户修复会话时间,但对于某些特定用户,我需要从代码手动减少。
我是什么尝试过:
在我的schenario中,我必须为所有用户修复会话超时,但对于某些特定用户,我需要手动减少代码。
我尝试使用以下代码设置会话超时但无法设置。
FormsAuthenticationConfiguration obj = new FormsAuthenticationConfiguration();
obj.Timeout = TimeSpan.FromMinutes(1);
How to increase or decrease session timeout from other then web config file. As in my schenario, I have to fix the session time out for all user but for some specific user i need to decrease manually from code.
What I have tried:
As in my schenario, I have to fix the session time out for all user but for some specific user i need to decrease manually from code.
I tried to set the session timeout using below code but not able to set.
FormsAuthenticationConfiguration obj = new FormsAuthenticationConfiguration();
obj.Timeout = TimeSpan.FromMinutes(1);
推荐答案
Session.Timeout = 1; // Minutes
这篇关于如何从其他Web配置文件增加或减少会话超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!