ASP.NET Razor/Webmatrix 站点注销用户太快.如何改变? [英] ASP.NET Razor/Webmatrix sites logout user too quickly. How to change?

查看:41
本文介绍了ASP.NET Razor/Webmatrix 站点注销用户太快.如何改变?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Webmatrix 中的 WebSecurity 组件非常漂亮,但用户的会话对我来说过期得太快了.它似乎以小时为单位,我希望会话超时更多地以天为单位.

如何更改会话超时时间?

解决方案

在回答您的问题时,您可以为 web.config 中的会话超时:

<预><代码><配置><system.web><sessionState timeout="value_in_minutes"></sessionState></system.web></配置>

默认情况下,会话在用户最后一次活动后 20 分钟到期.持续几天的会议似乎很疯狂.我绝对想不出任何合理的理由.你到底想解决什么问题?

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?

解决方案

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?

这篇关于ASP.NET Razor/Webmatrix 站点注销用户太快.如何改变?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆