zl程序教程

您现在的位置是:首页 >  后端

当前栏目

Control character in cookie value or attribute

Cookie in or value attribute Control character
2023-09-27 14:26:06 时间

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

(1)先清除缓存

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

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