@Override public HttpSession getSession() { return getSession(true); }
private SessionConfig.SessionCookieSource sessionCookieSource() { HttpSession session = getSession(false); if(session == null) { return SessionConfig.SessionCookieSource.NONE; } if(sessionCookieSource == null) { sessionCookieSource = originalServletContext.getSessionConfig().sessionCookieSource(exchange); } return sessionCookieSource; }
@Override public synchronized boolean create() { if (exists()) { return false; } session = context.getOriginalRequest().getSession(true); return session != null; }
@Override public void logout() throws ServletException { SecurityContext sc = exchange.getSecurityContext(); sc.logout(); if(servletContext.getDeployment().getDeploymentInfo().isInvalidateSessionOnLogout()) { HttpSession session = getSession(false); if(session != null) { session.invalidate(); } } }
private HttpSession session = context.getOriginalRequest().getSession(false);
@Override public void exchangeEvent(HttpServerExchange exchange, NextListener nextListener) { try { ServletRequestContext src = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY); if (finalSessionId == null) { // Has bot just created a session, if so make a note of it HttpSession s = src.getOriginalRequest().getSession(false); if (s != null) { clientIpSessionId.put(finalClientId, s.getId()); sessionIdClientIp.put(s.getId(), finalClientId); // #valueUnbound() will be called on session expiration s.setAttribute(SESSION_ATTRIBUTE_NAME, new CrawlerBindingListener(clientIpSessionId, sessionIdClientIp)); s.setMaxInactiveInterval(config.getSessionInactiveInterval()); if (UndertowLogger.REQUEST_LOGGER.isDebugEnabled()) { UndertowLogger.REQUEST_LOGGER.debug(exchange + ": New bot session. SessionID=" + s.getId()); } } } else { if (UndertowLogger.REQUEST_LOGGER.isDebugEnabled()) { UndertowLogger.REQUEST_LOGGER.debug(exchange + ": Bot session accessed. SessionID=" + finalSessionId); } } } finally { nextListener.proceed(); } } });
this.method = "GET"; this.queryString = servletRequest.getQueryString(); HttpSession session = servletRequest.getSession(false); if(session != null) { this.sessionId = session.getId();
final HttpSession session = hreq.getSession(false); if (session == null) { return false;
if ( src.getOriginalRequest().getSession(false) == null) {