Base64 encode / decode the cookie before setting / reading respectively, to avoid any UTF-8 funny business.
Don't try to read cookies out of an object that does not respond to