首页 > 技术文章 > Control character in cookie value or attribute

kongxc 2017-09-19 17:14 原文

在cookie中添加中文导致静态页面打不开,

(1)先清除缓存

(2)使用escape()函数对中文进行编码,获取的时候在对中文进行解码unescape()。

    cookie.Set("stoName",escape(stoName),2,"/");

 

推荐阅读