Skip to content

Commit

Permalink
Add a little workaround in NGApplication to allow session recovery
Browse files Browse the repository at this point in the history
  • Loading branch information
hugithordarson committed Jun 29, 2024
1 parent 4de11a0 commit 503d35f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ng-appserver/src/main/java/ng/appserver/NGApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -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" );
Expand Down

0 comments on commit 503d35f

Please sign in to comment.