[seam-issues] [JBoss JIRA] Created: (JBSEAM-4514) org.jboss.seam.core.Locale cookie

Frank Cornelis (JIRA) jira-events at lists.jboss.org
Tue Dec 29 02:21:30 EST 2009


org.jboss.seam.core.Locale cookie
---------------------------------

                 Key: JBSEAM-4514
                 URL: https://jira.jboss.org/jira/browse/JBSEAM-4514
             Project: Seam
          Issue Type: Bug
          Components: Core
    Affects Versions: 2.2.0.GA
         Environment: Firefox
            Reporter: Frank Cornelis
            Priority: Critical


The org.jboss.seam.core.Locale cookie has different values for the Path and Secure attributes compared to the JSESSIONID cookie. Probably because of this an SSL-secured web application cannot persist the locale selection when running your application on a remote JBoss AS. I guess the org.jboss.seam.core.Locale cookie should inherent some of the flags (Path, Secure) from the JSESSIONID to make it work. This logic should be implemented as part of Selector.setCookieValueIfEnabled. I haven't tested it out yet, but the code should probably look something like this:

boolean secure = false;
String path = this.cookiePath;
HttpServletRequest request = (HttpServletRequest) ctx.getExternalContext().getRequest();
Cookie[] cookies = request.getCookies();
if (null != cookies) {
    for (Cookie cookie : cookies) {
        if ("JSESSIONID".equals(cookie.getName()) {
            secure = cookie.getSecure();
            path = cookie.getPath();
            break;
        }
    }
}
HttpServletResponse response = (HttpServletResponse) ctx.getExternalContext().getResponse();
Cookie cookie = new Cookie( getCookieName(), value );
cookie.setMaxAge( getCookieMaxAge() );
cookie.setPath(path);
cookie.setSecure(secure);
response.addCookie(cookie);

See also: http://seamframework.org/Community/SeamLocaleIssues#comment111698

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the seam-issues mailing list