}
/** 写cookie。 */
private void writeSessionIDCookie(String cookieValue) {
CookieConfig cookieConfig = sessionConfig.getId().getCookie();
CookieSupport cookie = new CookieSupport(cookieConfig.getName(), cookieValue);
String cookieDomain = cookieConfig.getDomain();
if (!StringUtil.isEmpty(cookieDomain)) {
cookie.setDomain(cookieDomain);
}
String cookiePath = cookieConfig.getPath();
if (!StringUtil.isEmpty(cookiePath)) {
cookie.setPath(cookiePath);
}
int cookieMaxAge = cookieConfig.getMaxAge();
if (cookieMaxAge > 0) {
cookie.setMaxAge(cookieMaxAge);
}
cookie.setHttpOnly(cookieConfig.isHttpOnly());
cookie.setSecure(cookieConfig.isSecure());
log.debug("Set-cookie: {}", cookie);
cookie.addCookie(getResponse());
}