USER_DISCONNECT event not always providing access to session
Posted: 16 Nov 2024, 09:45
Hello everyone,
I'm using the following event handler:
I have a question regarding its behavior. Is the USER_DISCONNECT event always triggered when a user disconnects? I noticed that in some cases, I can access the user session like this:
But other times, I encounter an issue where the session is null. I was wondering:
Is the event always triggered for every disconnection?
What could cause the issue when accessing the session? The session should always be available, but it seems to be null in certain cases.
Thanks for your help!
I'm using the following event handler:
Code: Select all
addEventHandler(SFSEventType.USER_DISCONNECT, UserDisconnectHandler.class);I have a question regarding its behavior. Is the USER_DISCONNECT event always triggered when a user disconnects? I noticed that in some cases, I can access the user session like this:
Code: Select all
User user = (User) event.getParameter(SFSEventParam.USER);
Session session = (Session) user.getSession();But other times, I encounter an issue where the session is null. I was wondering:
Is the event always triggered for every disconnection?
What could cause the issue when accessing the session? The session should always be available, but it seems to be null in certain cases.
Thanks for your help!