I was able to implement session expiration after inactivity as described in this topic.
However, the session expiration is not made apparent to the User until they attempt to perform some action. I have the requirement to alert the User that their session is about to expire at least 20 seconds prior to it happening and give them the opportunity to extend it. If they do not extend the session, I need to send them back to the login screen as soon as the session time limit is reached.
I’ve been doing a lot of research on this topic but have yet to find a valid solution. I attempted to implement the UserInactivity Vaadin add-on, but found it introduced errors when opening a new browser tab after closing one.
I also considered using a Timer on the MainWindow to check the UserSessionEntity’s LastUsedTs value and compare it against the current timestamp, but calls to the UserSessionService cause that value to be updated.
With either of these approaches, I still wasn’t sure how I would even handle redirection to the login page.
Does anyone have any experience implementing this type of functionality?