Example: I want to limit logins to, say, five desktop and five mobile sessions at a time. Therefore I added a flag to each session like
request.getSession().setAttribute("Session-Type", "mobile");
Now while any user logs in I want to count all active mobile/desktop sessions and allow/disallow the login based on that count. How do I accomplish this?
I know I can use the SessionRegistry
to access Principals and/or their SessionInformation
, but not the actual session...
EDIT: I'm using Hazelcast to store the sessions, if this helps