diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java index 6b395ec42d..81ba7d7f17 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java @@ -333,10 +333,7 @@ public class AdempiereWebUI extends Window implements EventListener, IWeb appDesktop.logout(); Executions.getCurrent().getDesktop().getSession().getAttributes().clear(); - MSession mSession = MSession.get(Env.getCtx(), false); - if (mSession != null) { - mSession.logout(); - } + AEnv.logout(); SessionManager.clearSession(); super.getChildren().clear(); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/AEnv.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/AEnv.java index b698d361bd..72c7a90ce6 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/AEnv.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/AEnv.java @@ -49,6 +49,7 @@ import org.compiere.model.Lookup; import org.compiere.model.MAcctSchema; import org.compiere.model.MLookup; import org.compiere.model.MQuery; +import org.compiere.model.MSession; import org.compiere.util.CCache; import org.compiere.util.CLogger; import org.compiere.util.CacheMgt; @@ -189,9 +190,13 @@ public final class AEnv public static void logout() { - Env.logout(); - - + String sessionID = Env.getContext(Env.getCtx(), "#AD_Session_ID"); + windowCache.remove(sessionID); + // End Session + MSession session = MSession.get(Env.getCtx(), false); // finish + if (session != null) + session.logout(); + // } /** @@ -240,12 +245,12 @@ public final class AEnv log.config("Window=" + WindowNo + ", AD_Window_ID=" + AD_Window_ID); GridWindowVO mWindowVO = null; - String locale = Env.getLanguage(Env.getCtx()).getLocale().toString(); + String sessionID = Env.getContext(Env.getCtx(), "#AD_Session_ID"); if (AD_Window_ID != 0 && Ini.isCacheWindow()) // try cache { synchronized (windowCache) { - CCache cache = windowCache.get(locale); + CCache cache = windowCache.get(sessionID); if (cache != null) { mWindowVO = cache.get(AD_Window_ID); @@ -267,11 +272,11 @@ public final class AEnv { synchronized (windowCache) { - CCache cache = windowCache.get(locale); + CCache cache = windowCache.get(sessionID); if (cache == null) { cache = new CCache("AD_Window", 10); - windowCache.put(locale, cache); + windowCache.put(sessionID, cache); } cache.put(AD_Window_ID, mWindowVO); }