Could someone tell me why this code wouldn't write the cookie once a Seam event is
raised? Appears to be something odd with the way the response is being handled. Is there
something that resets the response when we enter the Seam event model?
@Observer("org.jboss.seam.postAuthenticate")
| public void processRememberMe(){
| User user = (User)Component.getInstance("user", false);
| UserAccountBase userAccnt = (UserAccountBase)
Contexts.getSessionContext().get("userAccount");
| FacesContext ctx = FacesContext.getCurrentInstance();
| String hash = encrypt(user.getUserName() + "." +
user.getUserPassword());
| Cookie cookie = new Cookie("userKey", hash);
| cookie.setPath("/");
| cookie.setMaxAge(31536000);
| HttpServletResponse res =
(HttpServletResponse)ctx.getExternalContext().getResponse();
| res.addCookie(cookie);
| userBO.addLoginCookie(hash, userAccnt.getUserKey());
| }
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4091108#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...