如何从12:00 – 12:30在asp.net中自动注销 [英] How To Automatically log out from 12:00 – 12:30 in asp.net
本文介绍了如何从12:00 – 12:30在asp.net中自动注销的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好
从12:00 – 12:30自动注销
hi all
Automatically log out from 12:00 – 12:30
推荐答案
嘿,我发现了这个 ^ ]可能对您有用.
enegadeMind给出了完美的答案
1)将每个请求(服务器和ajax(不包括会话检查ajax请求)到服务器的时间戳)保存到会话变量中.
2)经常使用ajax通过JS函数通过JS函数轮询服务器,并检查会话时间戳记与ajax请求时间之间的时间差是否大于会话超时val,然后注销当前用户并返回bool该ajax请求.
3)如果返回的布尔值为true,则将当前页面重定向到登录页面.
Hey I found this link-[Implementing Auto-Logout functionality][^] which might be useful for you.
enegadeMind gives perfect answer
1) Save the time-stamp of every request( server and ajax excluding the session check ajax request) to the server into a session var.
2) Poll the server via a JS function using ajax at frequent intervals and check if the time diff between the session time-stamp and the ajax request time is greater than the session timeout val then log-off the current user and return a bool for that ajax request.
3) Redirect the current page to the login page if the bool returned is true.
这篇关于如何从12:00 – 12:30在asp.net中自动注销的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文