Refine search
final SecurityHandler securityHandler) { SessionManager sessionManager = new HashSessionManager(); sessionManager.setMaxInactiveInterval( config.getInt(DrillOnYarnConfig.HTTP_SESSION_MAX_IDLE_SECS)); sessionManager.addEventListener(new HttpSessionListener() { @Override public void sessionCreated(HttpSessionEvent se) { return new SessionHandler(sessionManager);
public String encodeURL(String url) SessionManager sessionManager = request.getSessionManager(); if (sessionManager==null) return url; if (sessionManager.isCheckingRemoteSessionIdEncoding() && URIUtil.hasScheme(url)) if (port<0) port = HttpSchemes.HTTPS.equalsIgnoreCase(uri.getScheme())?443:80; if (!request.getServerName().equalsIgnoreCase(uri.getHost()) || request.getServerPort()!=port || !path.startsWith(request.getContextPath())) //TODO the root context path is "", with which every non null string starts return url; String sessionURLPrefix = sessionManager.getSessionIdPathParameterNamePrefix(); if (sessionURLPrefix==null) return url; if ((sessionManager.isUsingCookies() && request.isRequestedSessionIdFromCookie()) || !sessionManager.isUsingURLs()) if (!sessionManager.isValid(session)) return url; String id=sessionManager.getNodeId(session);
SessionManager sessionManager = getSessionManager(); HttpSession session = sessionManager.getHttpSession(requested_session_id); if (session != null && sessionManager.isValid(session)) baseRequest.setSession(session); return; if (_sessionManager.isUsingCookies()) final String sessionCookie=sessionManager.getSessionCookieConfig().getName(); for (int i = 0; i < cookies.length; i++) session = sessionManager.getHttpSession(requested_session_id); if (session != null && sessionManager.isValid(session)) String prefix = sessionManager.getSessionIdPathParameterNamePrefix(); if (prefix != null) session = sessionManager.getHttpSession(requested_session_id); if (LOG.isDebugEnabled()) LOG.debug("Got Session ID {} from URL",requested_session_id); baseRequest.setRequestedSessionId(requested_session_id); baseRequest.setRequestedSessionIdFromCookie(requested_session_id != null && requested_session_id_from_cookie); if (session != null && sessionManager.isValid(session)) baseRequest.setSession(session);
public HttpSession getSession(boolean create) { if (_session != null) { if (_sessionManager != null && !_sessionManager.isValid(_session)) _session = null; else return _session; } if (!create) return null; if (_sessionManager == null) throw new IllegalStateException("No SessionManager"); _session = _sessionManager.newHttpSession(this); HttpCookie cookie = _sessionManager.getSessionCookie(_session,getContextPath(),isSecure()); if (cookie != null) _connection.getResponse().addCookie(cookie); return _session; }
public String changeSessionId() { HttpSession session = getSession(false); if (session == null) throw new IllegalStateException("No session"); if (session instanceof AbstractSession) { AbstractSession abstractSession = ((AbstractSession)session); abstractSession.renewId(this); if (getRemoteUser() != null) abstractSession.setAttribute(AbstractSession.SESSION_KNOWN_ONLY_TO_AUTHENTICATED, Boolean.TRUE); if (abstractSession.isIdChanged()) _channel.getResponse().addCookie(_sessionManager.getSessionCookie(abstractSession, getContextPath(), isSecure())); } return session.getId(); }
context.getSessionHandler().getSessionManager().setMaxInactiveInterval(timeout * 60); modes.addAll(context.getSessionHandler().getSessionManager().getEffectiveSessionTrackingModes()); while (iter.hasNext()) context.getSessionHandler().getSessionManager().setSessionTrackingModes(modes); context.getSessionHandler().getSessionManager().getSessionCookieConfig().setName(name); context.getMetaData().setOrigin("cookie-config.name", descriptor); break; context.getSessionHandler().getSessionManager().getSessionCookieConfig().setName(name); context.getMetaData().setOrigin("cookie-config.name", descriptor); if (!context.getSessionHandler().getSessionManager().getSessionCookieConfig().getName().equals(name)) throw new IllegalStateException("Conflicting cookie-config name "+name+" in "+descriptor.getResource()); break; context.getSessionHandler().getSessionManager().getSessionCookieConfig().setDomain(domain); context.getMetaData().setOrigin("cookie-config.domain", descriptor); break; context.getSessionHandler().getSessionManager().getSessionCookieConfig().setDomain(domain); context.getMetaData().setOrigin("cookie-config.domain", descriptor); if (!context.getSessionHandler().getSessionManager().getSessionCookieConfig().getDomain().equals(domain)) throw new IllegalStateException("Conflicting cookie-config domain "+domain+" in "+descriptor.getResource()); break;
String connection = _channel.getRequest().getHeader(HttpHeader.CONNECTION.asString()); if (connection != null) if (HttpVersion.HTTP_1_0.is(_channel.getRequest().getProtocol())) _fields.put(HttpHeader.CONNECTION, HttpHeaderValue.KEEP_ALIVE.toString()); break; HttpSession session = request.getSession(false); if (session!=null && session.isNew()) if (sm!=null) HttpCookie c=sm.getSessionCookie(session,request.getContextPath(),request.isSecure()); if (c!=null) addCookie(c);
@Override public SessionCookieConfig getSessionCookieConfig() { // TODO other started conditions if (!_enabled) throw new UnsupportedOperationException(); if (_sessionHandler!=null) return _sessionHandler.getSessionManager().getSessionCookieConfig(); return null; }
connector.setPort(port); handler = new ServletContextHandler(server, "/", new SessionHandler(), new ConstraintSecurityHandler(), null, null); handler.getSessionHandler().getSessionManager().getSessionCookieConfig().setHttpOnly(true);
sessionManager.setMaxInactiveInterval(config.getInt(ExecConstants.HTTP_SESSION_MAX_IDLE_SECS)); sessionManager.getSessionCookieConfig().setHttpOnly(true); sessionManager.addEventListener(new HttpSessionListener() { @Override public void sessionCreated(HttpSessionEvent se) { return new SessionHandler(sessionManager);
@Override public HttpSession getHttpSession(String id) { return sessionManager.getHttpSession(id); } }
public void start() throws Exception { server = new Server(port); WebAppContext webAppContext = new WebAppContext(); webAppContext.setContextPath("/"); webAppContext.setWar("zenvisage.war"); webAppContext.setParentLoaderPriority(true); webAppContext.setServer(server); webAppContext.setClassLoader(ClassLoader.getSystemClassLoader()); webAppContext.getSessionHandler().getSessionManager() .setMaxInactiveInterval(10); server.setHandler(webAppContext); server.start(); // ZvMain zvMain = (ZvMain) SpringApplicationContext.getBean("zvMain"); // zvMain.loadData(); DatabaseAutoLoader databaseAutoLoader = new DatabaseAutoLoader(this); databaseAutoLoader.run(); }
context.setContextPath("/"); context.getSessionHandler().getSessionManager().setMaxInactiveInterval(serverConfig.getSessionTimeout()); context.addServlet(imgServletHolder, "/img/*"); context.getSessionHandler().addEventListener(new HttpSessionListener() {
@Override public HttpSession getHttpSession(String sessId) { return contextHandler.getSessionHandler().getSessionManager().getHttpSession(sessId); }
webAppContext.getSessionHandler().getSessionManager().setMaxInactiveInterval(getSessionTimeout() * 60); webAppContext.getSessionHandler().getSessionManager().getMaxInactiveInterval() );
/** * @param listener */ public void addEventListener(EventListener listener) { if (_sessionManager != null) _sessionManager.addEventListener(listener); }
SessionManager sessionManager = new HashSessionManager(); sessionManager.setMaxInactiveInterval(60 * 15); //session time out of 15 minutes HashSessionIdManager idManager = new HashSessionIdManager(); sessionManager.getSessionCookieConfig().setName("JSESSIONID_" + Integer.toString(m_serverSettings.getM_webServerPort())); sessionManager.setSessionIdManager(idManager); SessionHandler sessionHandler = new SessionHandler(sessionManager);
// To be passed to all scanned webapps. Ensures SSO between contexts SessionManager sessManager = new HashSessionManager(); SessionCookieConfig config = sessManager.getSessionCookieConfig(); config.setPath("/webapps/"); // Ensures all webapps share the same cookie // Create the Handler (a.k.a the WebAppContext). App app = new App(deployer, provider, module.getFile().getAbsolutePath()); WebAppContext handler = (WebAppContext)app.getContextHandler(); // getContextHandler does the extraction // Consolidating all scanned webapps under a single context path allows SSO handler.setContextPath("/webapps" + handler.getContextPath()); // Cookies need to be shared between webapps for SSO SessionHandler sessHandler = handler.getSessionHandler(); sessHandler.setSessionManager(sessManager);
abstractSession.setAttribute(AbstractSession.SESSION_KNOWN_ONLY_TO_AUTHENTICATED, Boolean.TRUE); if (abstractSession.isIdChanged() && response != null && (response instanceof Response)) ((Response)response).addCookie(abstractSession.getSessionManager().getSessionCookie(abstractSession, request.getContextPath(), request.isSecure())); LOG.debug("renew {}->{}",oldId,abstractSession.getId());
public String encodeURL(String url) SessionManager sessionManager = request.getSessionManager(); if (sessionManager==null) return url; if (sessionManager.isCheckingRemoteSessionIdEncoding() && URIUtil.hasScheme(url)) if (port<0) port = HttpSchemes.HTTPS.equalsIgnoreCase(uri.getScheme())?443:80; if (!request.getServerName().equalsIgnoreCase(uri.getHost()) || request.getServerPort()!=port || !path.startsWith(request.getContextPath())) //TODO the root context path is "", with which every non null string starts return url; String sessionURLPrefix = sessionManager.getSessionIdPathParameterNamePrefix(); if (sessionURLPrefix==null) return url; if ((sessionManager.isUsingCookies() && request.isRequestedSessionIdFromCookie()) || !sessionManager.isUsingURLs()) if (!sessionManager.isValid(session)) return url; String id=sessionManager.getNodeId(session);