Can an object be stored as a cookie in JSF? If so, does said object and its attributes need to be serializable?
For example, say shopping cart in an online store wants to use an ArrayList<StoreItem>
and save the array and the StoreItem
in a single cookie.
Example:
ArrayList<StoreItem> cart = new ArrayList<StoreItem>;
//StoreItems added to list
FacesContext.getCurrentInstance()
.getExternalContext()
.addResponseCookie("cart", cart, null);