code: public String id(){
          HttpServletRequest r = RequestContext.getHttpRequest();
          if(r == null){
              return null;
          }
          HttpSession session = r.getSession(false);
          return session == null ? null : session.getId();
      }
docs: Returns a session ID from underlying session.
  
  @return a session ID from underlying session, or null if session does not exist.