ASP.NET Razor/Webmatrix sites logout user too quickly. How to change?

主宰稳场 提交于 2020-01-04 09:56:26

问题


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:


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?



来源:https://stackoverflow.com/questions/7870778/asp-net-razor-webmatrix-sites-logout-user-too-quickly-how-to-change

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!