在计时器检查时检查会话超时 [英] check session timeout on timer check
本文介绍了在计时器检查时检查会话超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我将会话超时设置为2分钟
我的计时器每1分钟触发一次
i如果会话存在则每1分钟执行一次后端代码
如果用户在idel模式下超过2分钟然后重定向到登录页面
需要帮助
I set session timeout for 2 minute
my timer trigger after every 1 min
i want to execute backend code on every 1 min if session exist
if user in idel mode for more than 2 min then redirect to login page
need help
推荐答案
在计时器中的每一分钟事件中使用AJAX调用页面。
当有来电时,在服务器端执行操作。
从AJAX返回客户端后,你知道会话还活着。
干杯,
Edo
Use AJAX calls to the page on every one of those 1 minute event you have from the timer.
Perform actions on the server side when a call comes in.
Upon a return to the client side from AJAX you know that the session is alive.
Cheers,
Edo
这篇关于在计时器检查时检查会话超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文