Skip to content

Commit

Permalink
adds null check for session cookie config
Browse files Browse the repository at this point in the history
  • Loading branch information
gs-saurabh authored Oct 9, 2024
1 parent 32633fb commit c6c2a89
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,11 @@ public void run(org.finos.legend.server.shared.staticserver.StaticServerConfigur
private void makeSessionCookieSecure( ContextHandler.Context servletContext)
{
SessionCookieConfig sessionCookieConfig = servletContext.getSessionCookieConfig();
sessionCookieConfig.setSecure(true);
sessionCookieConfig.setHttpOnly(true);
if(sessionCookieConfig != null)
{
sessionCookieConfig.setSecure(true);
sessionCookieConfig.setHttpOnly(true);
}
servletContext.setAttribute(HttpCookie.SAME_SITE_DEFAULT_ATTRIBUTE, "STRICT");
}
}

0 comments on commit c6c2a89

Please sign in to comment.