Possible Duplicate:
Allowed characters in cookies
I need to separate values in a cookie. So I chose &'s to separate name=value pairs just like I would in a URL. There can be multiple values too for a name, so I separate those with a colon.
My question is if this is legal? Do I need to URL encode everything? The values can have colons inside them, so I thought I'd URL encode the values in order to make sure the colons in a value don't conflict with the separator character. I read somewhere that enclosing the entire cookie with apostrophes works too, does that make sense?
If this is not legal, what's the best way to store my multiple name/value pairs that often have multiple values per name (in a specific order, so I can't just duplicate the name/values)?