【问题标题】:Is possible reset the session time [instead of 20 min]/ or set session time more then 4 hours in c# MVC webapplication可以在 c# MVC webapplication 中重置会话时间 [而不是 20 分钟]/或将会话时间设置为 4 小时以上
【发布时间】:2019-06-21 23:47:36
【问题描述】:

从登录时间开始,会话应该使用 c# MVC Web 应用程序维持接下来的 4 小时

HttpContext ctx = HttpContext.Current;
            ctx.Session.Timeout = 240;

【问题讨论】:

  • 你在使用.net core吗?

标签: c# asp.net-mvc session


【解决方案1】:

在 web.config 文件中,您可以将会话超时值设置为 240(分钟)。

但应用程序池可能会在会话超时之前重新启动。在这种情况下,如果应用程序池重新启动,会话将重新启动。

因此,我们还需要在 IIS 中增加应用程序池超时。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2010-12-16
    • 2014-04-17
    • 2012-09-03
    • 2020-07-31
    • 2023-03-27
    • 1970-01-01
    • 2019-05-21
    • 1970-01-01
    相关资源
    最近更新 更多