public String getCurrentSessionId() {

    HttpSession session = getHttpSession();

    return session == null ? null : session.getId();
  }
Get the session id associated with the current thread-bound request.

@return the current session id; null if no request is associated with the current thread
ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariSessionManager.java