code: private String _getCookiePath(ExternalContext externalContext)
      {
          String contextPath = externalContext.getRequestContextPath();
  
          if (contextPath == null || "".equals(contextPath))
          {
              contextPath = "/";
          }
  
          return contextPath;
      }
docs: Returns the path for the Flash-Cookies.
  @param externalContext
  @return