Search in sources :

Example 1 with SessionCookieConfigImpl

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()));
        }
    }
}
Also used : ServletSessionConfig(io.undertow.servlet.api.ServletSessionConfig) SessionCookieConfigImpl(io.undertow.servlet.spec.SessionCookieConfigImpl)

Aggregations

ServletSessionConfig (io.undertow.servlet.api.ServletSessionConfig)1 SessionCookieConfigImpl (io.undertow.servlet.spec.SessionCookieConfigImpl)1