code: private HttpSession2 buildSession(String id, boolean refresh) {
          HttpSession2 session = new HttpSession2(id, sessionManager, request.getServletContext());
          session.setMaxInactiveInterval(maxInactiveInterval);
          if (refresh) {
              WebUtil.addCookie(this, response, getSessionCookieName(), id,
                      getCookieDomain(), getCookieContextPath(), cookieMaxAge, true);
          }
          return session;
      }
docs: build a new  session from session id
  @param id session id
  @param refresh refresh cookie or not
  @return session