我可以设置会话过期时间 [英] Can i set Session Expire time
本文介绍了我可以设置会话过期时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何设置会话过期时间?!
how Can i Set Session Expire time?!
推荐答案
是的,您可以: http://msdn.microsoft.com/en-us/library/ms525473%28v=vs.90%29.aspx [ ^ ]
Yes, you can: http://msdn.microsoft.com/en-us/library/ms525473%28v=vs.90%29.aspx[^]
Yup ....
可以通过在Web.Config文件中添加以下配置来实现。
Yup....
It is possible by adding the below configuration in your Web.Config file.
<system.web>
<sessionstate mode="InProc" timeout="1" />
</system.web>
这里你可以改变超时值..
here you can change the timeout value..
>
即使您只需在default.aspx页面加载时设置超时即可写入
even you can simply set timeout at the default.aspx page load by writing
//u can set timeout value as you wish however the time here is in miliseconds
Session.Timeout=30000
每次加载默认页面时更新会话
which renews session every time the default page loads
这篇关于我可以设置会话过期时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文