轮询会话空闲超时 [英] Polling with session idle timeout

查看:42
本文介绍了轮询会话空闲超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 Tomcat 中的所有应用程序使用单点登录.我的要求是,我必须轮询应该从后端获取的交易状态.但它也不应该影响会话的空闲超时.

I am using Single Sign on for all the applications in Tomcat. My requirement here is, I have to poll status of transaction which should be fetched from back end. But it should not affect the idle timeout of the session also.

有人可以建议是否可以做些什么吗?

Could anybody suggest if something could be done?

谢谢

推荐答案

我不知道是否有标准的方法可以做到这一点.如果没有,你可以写一个过滤器.

I don't know if there is a standard way to do this. If not, you could write a filter.

在过滤器中,忽略不计入的请求(例如您的轮询请求).

In the filter, ignore requests that do not count (e.g. your polling request).

对于其他请求,请检查上次请求时间(您应该已保存在会话中).如果时间足够长,则结束会话.否则,请节省新时间.

For other requests, check the last request time (which you should have saved in the session). If a long-enough time has elapsed end the session. Otherwise, save the new time.

很明显,您必须看看这会增加多少开销,但是——通过一些调整——它应该可以工作.

Clearly, you'll have to see what overhead this adds, but -- with a few tweaks -- it should work.

这篇关于轮询会话空闲超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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