I want to store some user data into a cookie so it's always there when they load the web app, even if the session has expired.
What's the best way of doing this with JSF?
Writing to a cookie:
FacesContext.getCurrentInstance()
.getExternalContext()
.addResponseCookie("CookieName", "value", null);
Reading the cookie
Map<String, Object> requestCookieMap = FacesContext.getCurrentInstance()
.getExternalContext()
.getRequestCookieMap();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With