如何强制会话暂停 20 分钟?
当谈到实际决定会话超时的因素时,我非常困惑。
Web 应用程序需要在登录(或丢弃)用户之前允许 20 分钟的“空闲时间”。 我在 IIS 中尝试了 sessionState 和 Recycle 工作进程的不同设置。 超时仍然太短,而且根据我的 quit-n-dirty、原始测试显示,有点随机。
我在某处读到默认超时为 20 分钟,但在我的应用程序中它似乎接近 5 分钟。 有什么简单的方法可以改变这种情况吗? 该应用程序在 IIS 6 上运行 .NET 3.5。
编辑: 我刚刚意识到实体框架可能与该问题有关,因为用户内容作为实体框架中的上下文保存。 实体的持有期限是否有时间限制?
I'm very confused when it comes to what actually decides the session time-out.
The web app needs to allow for a 20 minute "idle time" before logging (or throwing) users out. I've tried different setting on both sessionState and Recycle worker processes in IIS. The time-out remains too short and, as far as my quit-n-dirty, primitive tests have shown, a bit random.
I read somewhere that the default time-out is 20 minutes, but in my app it appears to be closer to five. Are there any easy ways to change this? The app is running .NET 3.5 on IIS 6.
EDIT:
I just realized that the Entity Framework might have something to do with the problem, as the user content is held as a context in the entity framework. Is there any time limit for how long an entity is held?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
用户将根据 web.config 中的身份验证设置注销。
会话超时将在 web.config 中的会话标记中设置。
如果它们不同,那么您将看到“有趣”的结果。
The user will be logged out based on your Authentication settings in the web.config.
The Session timout will be set in your session tag in the web.config.
If they are different then you will see "interesting" results.
http://msdn.microsoft.com/en-us/library/ms972429。 aspx
如果你查看 web.config,你可以写一些类似这样的东西
,在那里你可以设置超时..
http://msdn.microsoft.com/en-us/library/ms972429.aspx
If you look in the web.config you can write some thing like this
and there you can set you timeout..
使用会话状态超时。 您不想使用回收工作线程,因为这将每 N 分钟回收一次与该工作线程关联的所有会话。 如果您使用会话变量,最好将 Recycle Worker 设置为非常高的值。
Use the sessionstate timeout. You do not want to use Recycle Worker, as this will recycle all sessions associated with that worker, every N minutes. It's a good idea to set Recycle Worker to a very high value if you are using the session variable.