cookie.setPath("/");
StandardHost host = (StandardHost) ctx.getParent();
HttpServletRequest hreq =
(HttpServletRequest)request.getRequest();
if (host != null) {
host.configureSingleSignOnCookieSecure(cookie, hreq);
host.configureSingleSignOnCookieHttpOnly(cookie);
} else {
cookie.setSecure(hreq.isSecure());
}