If the objects in the ArrayList can be serialized, you can serialize the
ArrayList and then store the encoded form. You should be aware that there
are size limits to what is allowed in cookies (something like 4K per
cookie).
You should probably consider storing the information on the server and
storing an identifier in the cookie.