File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed
gemini/src/main/java/com/techempower/gemini Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -386,6 +386,20 @@ public Session getSession(boolean create)
386386 return this .session ;
387387 }
388388
389+ /**
390+ * In addition to invalidating the session, also sets the Context.session member variable to null
391+ * so it is re-created as needed and is available for immediate use.
392+ */
393+ public void invalidateSession ()
394+ {
395+ if (this .session != null )
396+ {
397+ this .session .invalidate ();
398+ }
399+ // Rely on getSession() to create a new session as needed.
400+ this .session = null ;
401+ }
402+
389403 /**
390404 * Gets the full standard (non-secure) URL to the Servlet.
391405 */
Original file line number Diff line number Diff line change @@ -306,11 +306,7 @@ public SessionNamedValues clear()
306306 */
307307 public SessionNamedValues invalidate ()
308308 {
309- final Session session = context .getSession (false );
310- if (session != null )
311- {
312- session .invalidate ();
313- }
309+ context .invalidateSession ();
314310 return this ;
315311 }
316312
You can’t perform that action at this time.
0 commit comments