如何强制会话暂停 20 分钟?

发布于 2024-07-16 07:26:34 字数 340 浏览 4 评论 0原文

当谈到实际决定会话超时的因素时,我非常困惑。

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

半葬歌 2024-07-23 07:26:34

用户将根据 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.

陈独秀 2024-07-23 07:26:34

http://msdn.microsoft.com/en-us/library/ms972429。 aspx

如果你查看 web.config,你可以写一些类似这样的东西

<configuration>
  <sessionstate timeout="20" />
</configuration>

,在那里你可以设置超时..

http://msdn.microsoft.com/en-us/library/ms972429.aspx

If you look in the web.config you can write some thing like this

<configuration>
  <sessionstate timeout="20" />
</configuration>

and there you can set you timeout..

尛丟丟 2024-07-23 07:26:34

使用会话状态超时。 您不想使用回收工作线程,因为这将每 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文