是否可以在Asp.net中将会话超时设置为1分钟? [英] Is it possible to set session timeout to 1 minute in Asp.net?

查看:80
本文介绍了是否可以在Asp.net中将会话超时设置为1分钟?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

出于测试目的,我想将会话超时设置为1分钟-可以吗?

For testing purpose I want to set session timeout to 1 minute - is it possible?

我已经在 web.config 中将超时定义为1分钟,但是它没有用(我听说默认超时是20分钟,所以最少20分钟?)

I have defined timeout as 1 minute in web.config, but it is not working (I heard default timeout is 20 minutes so minimum 20?)

<sessionState mode="StateServer" cookieless="false" timeout="1"/>

推荐答案

是的,您可以将其设置为少于20分钟.默认值20并不意味着最小值20.

Yes, you can set it to less than 20 minutes. Default 20 doesn't means minimum 20 .

此外,您还使用了Web.config的< sessionState> 元素,因此将其设置为:

Also, you used <sessionState> element of Web.config, so set it as:

<sessionState mode="StateServer" cookieless="false" timeout="1" />

在asp.net上查看此论坛: http://forums.asp.net/t/1725273.aspx/1

Check this forum on asp.net : http://forums.asp.net/t/1725273.aspx/1

这篇关于是否可以在Asp.net中将会话超时设置为1分钟?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆