Simple js class that saves a cookie as a JSON string.