在seam中用cookie时遇到这样一个问题,保存了cookie,但是在firefox在读不到这个保存的cookie.
解决方法:
在保存的时候加上下面这句就ok
参考资料:[url=http://seamframework.org/Community/SeamStoresCookiesIncorrectlyForWebApplicationWithEmtyRootPath]Seam stores cookies incorrectly for web application with emty root path[/url]
HttpServletResponse response = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();
Cookie cookie = new Cookie(name,value);
cookie.setMaxAge(Integer.MAX_VALUE);
cookie.setVersion(32140800);
response.addCookie(cookie);
解决方法:
在保存的时候加上下面这句就ok
cookie.setPath("/");
参考资料:[url=http://seamframework.org/Community/SeamStoresCookiesIncorrectlyForWebApplicationWithEmtyRootPath]Seam stores cookies incorrectly for web application with emty root path[/url]