This article mainly introduces the asp cookie Chinese Javascript to obtain Chinese cookies. The principle is to change the Chinese encoding into UTF-8 encoding format, pass it to the front desk, and then use JS to decode it.
Idea: Change the Chinese encoding to UTF-8 encoding format, pass it to the front desk, and then use JS to decode it.
Specific method: Change the relevant code for setting cookies to:
Server.URLEncode("Chinese")
Change the relevant JS code for obtaining cookies to:
Copy the code code as follows:
var tmp=document.cookie.split(";")[0].split("=")[1];
var name= decodeURIComponent (tmp);