Reputation: 8090
In my RAP application I need to do some logout handling (forward do keycloak sso/logout). Where would be a good hook to do that?
org.eclipse.ui.application.WorkbenchAdvisor.postShutdown()
is executed also if I refresh my browser window (F5), I don't want the session to logout on-refresh.
Rather if the session is expired or the browser window is closed.
Is there a hook for expired sessions or a session invalidation event?
Found UISessionListener.beforeDestroy()
but it also is executed on browser-refresh:
RWT.getUISession().addUISessionListener(new UISessionListener() {
@Override
public void beforeDestroy(UISessionEvent event) {
System.out.println("UISessionListener.beforeDestroy" + event);
}
});
Upvotes: 0
Views: 246
Reputation: 1822
Code show that UISessionListener catch the event UISessionEvent that contains UISession. This object is bound to HttpSession, if you don't wont to expire just configure session to endless(better to make it quit long but not endless depends on amount of users using application).
HttpSession has expiration time by default (for example for apache tomcat it is 30m). But it is configurable. Session expired when not single "touch" of session (request) in such timeout occurs.
Also by default session will "survive" during tab close/open, since cookie saved on client side (again this behaviour configurable).
Upvotes: 0