ASP.NET Razor/Webmatrix sites logout user too quic

2019-07-11 04:05发布

The WebSecurity component in Webmatrix is pretty slick, but users' sessions expire too quickly for me. It seems like it's measured in hours and I'd like the session timeout to be more in terms of days.

How do I change the session timeout?

1条回答
劫难
2楼-- · 2019-07-11 04:38

In answer to your question, you can set any value for session timeout in your web.config:

<configuration>
  <system.web>
     <sessionState timeout="value_in_minutes"></sessionState>
  </system.web>
</configuration>

By default, sessions expire 20 minutes after the last activity from the user. Having sessions last for days seems insane. There is absolutely no sensible reason that I can think of for that. What problem are you trying to solve, exactly?

查看更多
登录 后发表回答