java - How can I serve requests to a client without refreshing the user's session? -


i have app implement "real-time" polling in hitting endpoint frequency. update needs not refresh session, session can timed out @ last action wasn't poll.

is there way exclude routes updating user's session expiry, still requiring user's session authentication?

if "reflreshing" request bears jsessionid token, session automatically refreshed. must unauthenticated (ie. no jsessionid) requests endpoint.

so, how relate request existing user without session id ? add headers request, containing enough informations identify user on server side (for example, jwt token). httpfilter protect endpoint , perform authentification based on token.

now, there problem. determine if there new data available particular user, assume endpoint have query user's state. if state entirely store user's httpsession, you're screwed - cannot accessed programmatically, via jsessionid, refreshes timeout.

the solution here externalize user's data (or @ least, relevant real-time stuff) storage system (an in-memory map, redis cache, oracle or mongodb database...).

this requires quite work indeed...


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -