code: public String getSessionId(boolean create) {
          String result = "";
          if (defaultExternalContext != null) {
              result = defaultExternalContext.getSessionId(create);
          } else {
              throw new UnsupportedOperationException();
          }
          return result;
      }
docs: <p class="changed_added_2_2">Return the id of the current session
  or the empty string if no session has been created and the
  <code>create</code> parameter is <code>false</code>.</p>
  
  <div class="changed_added_2_2">
  
  <p><em>Servlet:</em> If <code>create</code> is true, obtain
  a reference to the <code>HttpSession</code> for the current request
  (creating the session if necessary) and return its id.  If
  <code>create</code> is <code>false</code>, obtain a reference to the
  current session, if one exists, and return its id.  If no session exists,
  return the empty string.</p>
  
  </div>
  
  @since 2.2
  
  @param create Flag indicating whether or not a new session should be
  created if there is no session associated with the current request