当向Cookie中写入中文时,会出现
Control character in cookie value错误
?
解决方案:将要写入Cookie的数据进行URLEncoder.encode(value,"utf-8")编码。
?
userMsgStr = URLEncoder.encode(userMsgStr, "UTF-8");
?同意 当提取出来时 要进行解码
value = URLDecoder.decode(cookie.getValue(),"UTF-8");
?
向Cookie中写入中文时出现Control character in cookie value
原文:http://124654439.iteye.com/blog/2159656