开发者

jQuery - Fire event at the end of a session?

Is it possible to fire an event at the END of a users session?

What I'开发者_运维问答m trying to achieve is to set a cookie based on the response to a 'pop up' question. If the answer is YES i'd like to redirect somewhere at the end of a session.

Is this possible?


If you do this on each page or AJAX load:

clearTimeout(sessionTimeout);
sessionTimeout = setTimeout(onSessionEnd, TIMEOUT_IN_MINUTES*60*1000);

the function onSessionEnd() will get called when the session times out. As far as I know, the JS can't pick it out from the cookie, you need to tell your code what the timeout will be.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜