ExpressJS unicode cookie
问题 Is there any way to send unicode values in a cookie in expressjs. When a user is using a Spanish locale, a cookie is serialized with the user name, which can be something like "José" e.g: res.cookie('user', JSON.stringify({name: 'José'})); However in the client I get a cookie with the value: {name: 'José'} is there any way around this? The server already outputs that. 回答1: To be able to use unicode characters in a cookie, you should use an encoding scheme. encodeURIComponent() or querystring