Web应用程序中的会话时间 [英] Session Time out Of a web application
本文介绍了Web应用程序中的会话时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
假设用户登录了网站.
如果用户在一定时间内未触摸键盘和鼠标,则该用户的会话将被破坏.
我该如何使用ASP.net(c#)
请给我答案
Suppose the user log in a website.
If user does not touch the keyboard and mouse for a certain time, then the session is destroyed for that user.
How can i do this using ASP.net(c#)
Please give me the answer
推荐答案
设置会话超时属性或web.config中使用的机器密钥
set session timeout property or used machine key in web.config
<configuration>
<sessionstate mode="inproc" timeout="20"/>
</configuration>
将此代码添加到配置标记内的Web配置文件中
10000是秒
add this code in web config file within configuration tag
10000 is seconds
转到web.config文件中的此部分
go to this section in web.config file
<session-config>
<session-timeout>30</session-timeout>
</session-config>
这篇关于Web应用程序中的会话时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文