So, the scenario is : User A logs in and working in the system with credentials X. User B, who is also a friend of A, want to log in using same credentials. As per the requirement, we are showing an alert saying some user is already logged in with same id and you want to continue by killing that session.
If the User B agrees, we need to kick the User A out of system. Now, what I would like to achieve is, once that killSession() method(in Spring Controller) is called, I have to send a push notification to the browser client of User A and log him out of the system.
I don't want to achieve this by setTimeout kinda stuff. I would like to trigger it from Server, so it doesn't create lot of HTTP requests to know if his session is alive or not.
Can you guys please help me what framework or lib I use to achieve this. I am a little new to this, and all I did was tried SockJS and Socket.IO but without any success because of my lack of understanding on how to do this. Appreciate any help guys!!