【问题标题】:How to increase or decrease session timeout from other then web config file如何从其他 Web 配置文件中增加或减少会话超时
【发布时间】:2016-12-17 04:27:18
【问题描述】:

如何通过其他 web 配置文件增加或减少会话超时?

在我的方案中,我必须为所有用户修复会话超时,但对于某些特定用户,我需要从代码中手动减少它。

我尝试使用以下代码设置会话超时,但没有成功。

FormsAuthenticationConfiguration obj = new FormsAuthenticationConfiguration(); obj.Timeout = TimeSpan.FromMinutes(1);

【问题讨论】:

    标签: asp.net asp.net-mvc session web-config


    【解决方案1】:

    Session_OnStartevent 上,您可以按照此处的说明拨打HttpContext.Current.Session.Timeout = 1;How can set different session timeout

    【讨论】:

    • 感谢您的回复。我将执行相同的操作并让您知道。
    猜你喜欢
    • 1970-01-01
    • 2015-12-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-09-27
    • 1970-01-01
    • 2012-01-29
    • 2011-01-22
    相关资源
    最近更新 更多