From 1231767cc19a6fc7560dde48b370738e57752978 Mon Sep 17 00:00:00 2001 From: michaeloffner Date: Mon, 18 Mar 2024 17:43:31 +0100 Subject: [PATCH] only reset session/client when enabled --- .../runtime/type/scope/ScopeContext.java | 21 +++++++++++++------ loader/build.xml | 2 +- loader/pom.xml | 2 +- 3 files changed, 17 insertions(+), 8 deletions(-) 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..47289fbeef 100755 --- a/core/src/main/java/lucee/runtime/type/scope/ScopeContext.java +++ b/core/src/main/java/lucee/runtime/type/scope/ScopeContext.java @@ -993,15 +993,24 @@ public void invalidateUserScope(PageContextImpl pc, boolean migrateSessionData, ApplicationContext appContext = pc.getApplicationContext(); RefBoolean isNew = new RefBooleanImpl(); + boolean hasClientManagment = appContext.isSetClientManagement(); + boolean hasSessionManagment = appContext.isSetSessionManagement(); + // get in memory scopes - Map clientContext = getSubMap(cfClientContexts, appContext.getName()); - UserScope oldClient = (UserScope) clientContext.get(pc.getCFID()); - Map sessionContext = getSubMap(cfSessionContexts, appContext.getName()); - UserScope oldSession = (UserScope) sessionContext.get(pc.getCFID()); + UserScope oldClient = null; + if (hasClientManagment) { + Map clientContext = getSubMap(cfClientContexts, appContext.getName()); + oldClient = (UserScope) clientContext.get(pc.getCFID()); + } + UserScope oldSession = null; + if (hasSessionManagment) { + Map sessionContext = getSubMap(cfSessionContexts, appContext.getName()); + oldSession = (UserScope) sessionContext.get(pc.getCFID()); + } // remove Scopes completly - removeCFSessionScope(pc); - removeClientScope(pc); + if (hasSessionManagment) removeCFSessionScope(pc); + if (hasClientManagment) removeClientScope(pc); pc.resetIdAndToken(); pc.resetSession(); diff --git a/loader/build.xml b/loader/build.xml index ef503cf24e..6abd617fa7 100644 --- a/loader/build.xml +++ b/loader/build.xml @@ -2,7 +2,7 @@ - + diff --git a/loader/pom.xml b/loader/pom.xml index 94d8e36ba6..a7c808f126 100644 --- a/loader/pom.xml +++ b/loader/pom.xml @@ -3,7 +3,7 @@ org.lucee lucee - 6.0.1.82-SNAPSHOT + 6.0.2.0-SNAPSHOT jar Lucee Loader Build