diff --git a/core/src/main/java/lucee/runtime/type/scope/ScopeContext.java b/core/src/main/java/lucee/runtime/type/scope/ScopeContext.java index 2108bbba22..fb6c49c773 100755 --- a/core/src/main/java/lucee/runtime/type/scope/ScopeContext.java +++ b/core/src/main/java/lucee/runtime/type/scope/ScopeContext.java @@ -999,6 +999,15 @@ public void invalidateUserScope(PageContextImpl pc, boolean migrateSessionData, Map sessionContext = getSubMap(cfSessionContexts, appContext.getName()); UserScope oldSession = (UserScope) sessionContext.get(pc.getCFID()); + ApplicationListener listener = factory.getConfig().getApplicationListener(); + try { + listener.onSessionEnd(factory, appContext.getName(), pc.getCFID()); + } + catch (Throwable t) { + ExceptionUtil.rethrowIfNecessary(t); + ExceptionHandler.log(pc.getCfmlFactory(), Caster.toPageException(t)); + } + // remove Scopes completly removeCFSessionScope(pc); removeClientScope(pc);