pillarjs / cookies

Signed and unsigned cookies based on Keygrip
MIT License
1.29k stars 152 forks source link

can't set cookie when the string includes Chinese #106

Closed hackers267 closed 5 years ago

hackers267 commented 5 years ago

when the string includes Chinese ,throw error: TypeError: argument name is invalid

dougwilson commented 5 years ago

This is because header and cookie values can only contain a subset of us-ascii. You have to encode the value in some method and then use the same method to decode when you read back the value.