modes.add(SessionTrackingMode.valueOf(trackMode)); context.getSessionHandler().setSessionTrackingModes(modes);
/** * Constructor. */ public SessionHandler() { setSessionTrackingModes(__defaultSessionTrackingModes); }
@Override public void setSessionTrackingModes(Set<SessionTrackingMode> sessionTrackingModes) { if (!isStarting()) throw new IllegalStateException(); if (!_enabled) throw new UnsupportedOperationException(); if (_sessionHandler!=null) _sessionHandler.setSessionTrackingModes(sessionTrackingModes); }
wac.setThrowUnavailableOnStartupException(true); // if boot fails, abort the process instead of letting empty Jetty run wac.setMimeTypes(mimeTypes); wac.getSessionHandler().setSessionTrackingModes(Collections.singleton(SessionTrackingMode.COOKIE)); wac.getSessionHandler().setSessionCookie(WinstoneSession.SESSION_COOKIE_NAME); this.webapps.put(wac.getContextPath(),wac);
private void configureSessionManager(final ServletContextHandler context) throws Exception { final SessionHandler sessionHandler = context.getSessionHandler(); sessionHandler.setMaxInactiveInterval(this.config.getSessionTimeout() * 60); sessionHandler.setSessionIdPathParameterName(this.config.getProperty(JettyConfig.FELIX_JETTY_SERVLET_SESSION_ID_PATH_PARAMETER_NAME, SessionHandler.__DefaultSessionIdPathParameterName)); sessionHandler.setCheckingRemoteSessionIdEncoding(this.config.getBooleanProperty(JettyConfig.FELIX_JETTY_SERVLET_CHECK_REMOTE_SESSION_ENCODING, true)); sessionHandler.setSessionTrackingModes(Collections.singleton(SessionTrackingMode.COOKIE)); final SessionCookieConfig cookieConfig = sessionHandler.getSessionCookieConfig(); cookieConfig.setName(this.config.getProperty(JettyConfig.FELIX_JETTY_SERVLET_SESSION_COOKIE_NAME, SessionHandler.__DefaultSessionCookie)); cookieConfig.setDomain(this.config.getProperty(JettyConfig.FELIX_JETTY_SERVLET_SESSION_DOMAIN, SessionHandler.__DefaultSessionDomain)); cookieConfig.setPath(this.config.getProperty(JettyConfig.FELIX_JETTY_SERVLET_SESSION_PATH, context.getContextPath())); cookieConfig.setMaxAge(this.config.getIntProperty(JettyConfig.FELIX_JETTY_SERVLET_SESSION_MAX_AGE, -1)); cookieConfig.setHttpOnly(this.config.getBooleanProperty(JettyConfig.FELIX_JETTY_SESSION_COOKIE_HTTP_ONLY, true)); cookieConfig.setSecure(this.config.getBooleanProperty(JettyConfig.FELIX_JETTY_SESSION_COOKIE_SECURE, false)); }
modes.add(SessionTrackingMode.valueOf(trackMode)); context.getSessionHandler().setSessionTrackingModes(modes);