code: public static Cookie getSSOCookieFromSSOToken() throws Exception {
          Subject subject = null;
          Cookie ltpaCookie = null;
          if (webAppSecConfig == null) {
              // if we don't have the config, we can't construct the cookie
              return null;
          }
          try {
              subject = WSSubject.getRunAsSubject();
              if (subject == null) {
                  subject = WSSubject.getCallerSubject();
              }
              if (subject != null) {
                  ltpaCookie = getLTPACookie(subject);
              } else {
                  if (tc.isDebugEnabled()) {
                      Tr.debug(tc, "No subjects on the thread");
                  }
              }
          } catch (Exception e) {
              if (tc.isDebugEnabled()) {
                  Tr.debug(tc, "getSSOCookieFromSSOToken caught exception: " + e.getMessage());
              }
              throw e;
          }
          return ltpaCookie;
      }
docs: Extracts an LTPA sso cookie from the subject of current thread
  and builds a ltpa cookie out of it for use on downstream web invocations.
  The caller must check for null return value only when not null
  that getName and getValue can be invoked on the returned Cookie object
  
  @return an object of type javax.servlet.http.Cookie. When the returned value is not
  null use Cookie methods getName() and getValue() to set the Cookie header
  on an http request with header value of Cookie.getName()=Cookie.getValue()