The ExternalContext.addResponseCookie(String name, String value, Map<String,Object> properties) method was added as of JSF 2.0.
The FacesBridge must follow the requirements in the JSF 2.2 JavaDoc. However, rather than calling HttpServletResponse.addCookie(Cookie), the FacesBridge must call
- During an action, call ActionResponse.addCookie(cookie)
- Upon subsequent render, call RenderRequest.getCookies() to verify that the cookie is present
Note that it is not valid to test for the presence of the cookie on the client, because the Portlet 3.0 JavaDoc for PortletResponse.addProperty(Cookie) states
"The portlet should note that the cookie may not make it to the client, but may be stored at the portal"