}
public static void setSSOCookie(String id_, String ssoId_) {
if (ssoId_ == null) {
return;
}
WebContext webContext = WebContextFactory.get();
Cookie ssoCookie = new Cookie(SSOConstants.SSO_SSO_ID, ssoId_);
ssoCookie.setMaxAge(-1); // when browser is closed.
ssoCookie.setPath("/");
webContext.getHttpServletResponse().addCookie(ssoCookie);
HttpServletRequest req = webContext.getHttpServletRequest();
if (req != null) {
HttpSession ss = req.getSession(true);
ss.setAttribute(SSOConstants.SSO_ID, id_);
ss.setAttribute(SSOConstants.SSO_SSO_ID, ssoId_);
}