The issue isn't that cookies are key/value pairs. Hashes are also key/value pairs, but the value in that pair can be a reference (or any other arbitrary scalar).
The issue is that cookies only accept strings as their values.
Comment on Re^2: CGI cookie turns array ref into string