use of io.undertow.servlet.spec.SessionCookieConfigImpl in project undertow by undertow-io.
the class DeploymentManagerImpl method handleDeploymentSessionConfig.
public void handleDeploymentSessionConfig(DeploymentInfo deploymentInfo, ServletContextImpl servletContext) {
SessionCookieConfigImpl sessionCookieConfig = servletContext.getSessionCookieConfig();
ServletSessionConfig sc = deploymentInfo.getServletSessionConfig();
if (sc != null) {
sessionCookieConfig.setName(sc.getName());
sessionCookieConfig.setComment(sc.getComment());
sessionCookieConfig.setDomain(sc.getDomain());
sessionCookieConfig.setHttpOnly(sc.isHttpOnly());
sessionCookieConfig.setMaxAge(sc.getMaxAge());
if (sc.getPath() != null) {
sessionCookieConfig.setPath(sc.getPath());
} else {
sessionCookieConfig.setPath(deploymentInfo.getContextPath());
}
sessionCookieConfig.setSecure(sc.isSecure());
if (sc.getSessionTrackingModes() != null) {
servletContext.setDefaultSessionTrackingModes(new HashSet<>(sc.getSessionTrackingModes()));
}
}
}
Aggregations