Actually i think it would be better to use document.cookie = "myCookie=foo='bar'&baz='poo'; here is the rest of cookie specifications if you like..."
as far as i know, it also is compatible with Asp and Asp.Mvc on server side: string foo=Request.Cookies["myCookie"]["foo"]