Storing complex data inside cookies can be hard. Using ad-hoc encoding makes it harder, especially when other developers need to work on your project. Using an ad-hoc encoding scheme is bad for these reasons:
JSON Cookie stores native JavaScript objects within cookies. It works by serializing objects into JSON strings and storing them with jQuery Cookie. When read back in, it retrieves the cookie via jQuery Cookie and deserializes the object with JSON. Try out the demo below.