From 503d35fb7f2270f4d6c0077099c81ab5eb6becfe Mon Sep 17 00:00:00 2001 From: Hugi Thordarson Date: Sat, 29 Jun 2024 09:19:24 +0000 Subject: [PATCH] Add a little workaround in NGApplication to allow session recovery --- .../src/main/java/ng/appserver/NGApplication.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ng-appserver/src/main/java/ng/appserver/NGApplication.java b/ng-appserver/src/main/java/ng/appserver/NGApplication.java index 80578eb9..6469a61d 100644 --- a/ng-appserver/src/main/java/ng/appserver/NGApplication.java +++ b/ng-appserver/src/main/java/ng/appserver/NGApplication.java @@ -203,12 +203,19 @@ private NGRouteTable createSystemRoutes() { } /** - * FIXME: This needs cleanup. And perhaps... A better mechanism overall? // Hugi 2024-03-17 + * FIXME: This needs a better mechanism overall // Hugi 2024-03-17 */ private NGActionResults resetSessionCookie() { + return resetSessionCookieWithRedirectToURL( "/" ); + } + + /** + * FIXME: This method should not exist, it's currently used by subclasses as a workaround for some bad session management // Hugi 2024-06-29 + */ + protected NGActionResults resetSessionCookieWithRedirectToURL( final String url ) { final NGResponse response = new NGResponse(); - response.setHeader( "location", "/" ); + response.setHeader( "location", url ); response.setStatus( 302 ); response.setHeader( "content-type", "text/html" ); response.setHeader( "content-length", "0" );