host.setName("localhost");
StandardContext container = new StandardContext();
container.setPath(contextPath);
host.addChild(container);
SessionCookie cookie = container.getSessionCookie();
if (cookiePath != null)
cookie.setPath(cookiePath);
if (cookieComment != null)
cookie.setComment(cookieComment);
if (cookieDomain != null)
cookie.setDomain(cookieDomain);
cookie.setHttpOnly(httpOnly);
cookie.setSecure(secure);
return container;
}