IDEMPIERE-5049 Zk Session and Desktop object not destroy immediately after logout (#997)
- Fix invalidation of session
This commit is contained in:
parent
06698688ef
commit
460a4798e9
|
@ -408,10 +408,7 @@ public class AdempiereWebUI extends Window implements EventListener<Event>, IWeb
|
|||
*/
|
||||
public void logout()
|
||||
{
|
||||
final Desktop desktop = Executions.getCurrent().getDesktop();
|
||||
if (desktop.isServerPushEnabled())
|
||||
desktop.enableServerPush(false);
|
||||
|
||||
final Desktop desktop = Executions.getCurrent().getDesktop();
|
||||
final WebApp wapp = desktop.getWebApp();
|
||||
final DesktopCache desktopCache = ((WebAppCtrl) wapp).getDesktopCache(desktop.getSession());
|
||||
final Session session = logout0();
|
||||
|
@ -438,7 +435,7 @@ public class AdempiereWebUI extends Window implements EventListener<Event>, IWeb
|
|||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
session.invalidate();
|
||||
((SessionCtrl)session).invalidateNow();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -454,7 +451,9 @@ public class AdempiereWebUI extends Window implements EventListener<Event>, IWeb
|
|||
|
||||
//clear context, invalidate session
|
||||
Env.getCtx().clear();
|
||||
destroySession(session);
|
||||
SessionCtrl ctrl = (SessionCtrl) session;
|
||||
if (!ctrl.isInvalidated() && session.getNativeSession() != null)
|
||||
destroySession(session);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -105,12 +105,9 @@ public class DesktopWatchDog {
|
|||
}
|
||||
if (!toDestroy.isEmpty()) {
|
||||
for(Session session : toDestroy) {
|
||||
try {
|
||||
((SessionCtrl)session).onDestroyed();
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
session.invalidate();
|
||||
if (!((SessionCtrl)session).isInvalidated()) {
|
||||
((SessionCtrl)session).invalidateNow();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue