在asp.net中延长会话过期时间

编程入门 行业动态 更新时间:2024-10-28 01:20:08
本文介绍了在asp中延长会话过期时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经在用户登录时在asp4.0中开发了一个网站,然后20分钟后自动会话期满,并且用户再次进入登录页面并重新登录. 我想将会话状态值扩展到4小时,这是可能的. 谢谢

i have developed a website in asp4.0 in this website when user Log in then after 20 minutes automatic session expires and user go to again login page and re login . i want to extend session state value to 4 hours how it is possible. Thank You

推荐答案

增加Web.Config文件中的超时时间: Increase the timeout in the Web.Config file: <system.web> <sessionState mode="InProc" timeout="240"></sessionState> </system.web>

如果这是您真正要设置的时间,则会将Web应用程序的超时设置为240分钟.

This would set the timeout as 240 minutes for your web application if that''s what you really want to set.

从您的网站打开web.config文件并设置此参数. Open web.config file from your website and set this parameter.

<system.web> <sessionState mode="InProc" timeout="240"></sessionState> </system.web>

打开web.config并在< system.web>之后键入此代码.标签: Open web.config and type this code after <system.web> tag: <sessionstate timeout="4" mode="InProc"></sessionstate>

HttpSessionState.Timeout属性

HttpSessionState.Timeout Property

更多推荐

在asp.net中延长会话过期时间

本文发布于:2023-11-09 22:36:45,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1573619.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:时间   asp   net

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!