30分钟后如何使asp.net网页过期 [英] how to expire a asp.net web page after 30 min
本文介绍了30分钟后如何使asp.net网页过期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在30分钟后使asp.net网页失效
how to expire a asp.net web page after 30 min
推荐答案
您可以使用会话状态的超时属性来强制页面数据(存储在该会话中)在设定的时间间隔后到期,例如在此处中解释了 [
You can use the session state''s timeout property to force the page data (stored within that session) to expire after a set interval of time e.g. explained here[^].
尝试这个
在webconfig中使用sessionstate
hi try this
using sessionstate in webconfig
<sessionState cookieless="UseCookies" timeout="20" regenerateExpiredSessionId="true" useHostingIdentity="true">
</sessionState>
它会过期20分钟
以及在应用设置中
it will expire for 20 minutes
and in appsettings
<add key="dbConn" value="Data Source=ythisbug;User ID=sa;Password=password;Pooling=True;Max Pool Size=200;Connect Timeout=200" />
试试这个..
最好..
try this..
All The Best..
Response.Cookies("whereq").Expires = DataTime.Now;
Response.Cookies("whereq").Expires = DataTime.Now;
这篇关于30分钟后如何使asp.net网页过期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文