Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable session cookie secure and httponly settings #15

Open
tuxBurner opened this issue Feb 18, 2019 · 0 comments
Open

Enable session cookie secure and httponly settings #15

tuxBurner opened this issue Feb 18, 2019 · 0 comments

Comments

@tuxBurner
Copy link
Member

Enable following settings in Jetty Configuration:

  • servletContext.getSessionHandler().getSessionManager().getSessionCookieConfig().setSecure(true);

  • servletContext.getSessionHandler().getSessionManager().getSessionCookieConfig().setHttpOnly(true);
    Via Config

  • Enable <Set name="forwarded">true</Set>

HttpConfiguration http_config = new HttpConfiguration();

  // Add support for X-Forwarded headers
  http_config.addCustomizer(new org.eclipse.jetty.server.ForwardedRequestCustomizer());
  • Check other settings.
    make HttpConfiguration http_config = new HttpConfiguration(); in a protected method
  • Support Session Methods. Sample:
sessionHandler.getSessionManager().setSessionTrackingModes(
       new HashSet<SessionTrackingMode>(Arrays.asList(new SessionTrackingMode[] { SessionTrackingMode.COOKIE })));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant