如果会话过期,视图状态是否仍然存在?

发布于 2024-08-15 06:58:48 字数 114 浏览 1 评论 0原文

我已在 IIS 级别将会话超时设置为 20 分钟,并且 web.config 中没有会话条目。

我如何知道我的网站中的会话是否已过期?

国家会维持吗?超时后我可以看到文本框中的值吗?

i have set the session timeout to 20 minutes in IIS level and there is no session entries in the web.config.

How can i know whether my session exprired in my website?

does the state will maintain ? do i can see the values in the text-boxes after the timeout?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

日记撕了你也走了 2024-08-22 06:58:48

视图状态仍然存在。由于 ASP.Net 仍然依赖于良好的 HTTP 表单处理,因此您只需读取 request.forms 即可查看发布的值。

至于查看会话是否已过期,请获取会话 ID 并将其存储在隐藏输入甚至 ViewState 属性中,然后将存储的会话 ID 与“当前”会话 ID 进行比较,如果它们不同,则新会话已生成开始了。

Viewstate remains. Since ASP.Net still relies on good ol' HTTP forms processing, you can just read request.forms to see the posted values.

As far as seeing if the session espired, take the session ID and store it in a hidden input or even a ViewState property, then compare the stored session ID with the 'current' session ID and if they're different then a new session has started.

要走干脆点 2024-08-22 06:58:48

下面的链接向您展示了如何检查新会话是否已创建并采取必要步骤的实现,

视图状态将得到维护

检测ASPNET_Session_Timeouts

这里回答了 Stackoverflow 问题

会话已过期

Below link show you the implementation of how you can check that new session is created and take the necessary steps

Viewstate will be maintained

Detecting ASPNET_Session_Timeouts

Stackoverflow question answered here

Session Expired

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