diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSession.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSession.java index c4696ee2854..4d8e3091731 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSession.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSession.java @@ -307,16 +307,19 @@ public abstract class AbstractSession implements AbstractSessionManager.SessionI _manager.removeSession(this,true); // Notify listeners and unbind values + boolean do_invalidate=false; synchronized (this) { if (!_invalid) { if (_requests<=0) - doInvalidate(); + do_invalidate=true; else _doInvalidate=true; } } + if (do_invalidate) + doInvalidate(); } /* ------------------------------------------------------------- */