进行URL编解码的时候,一定不要忘了编码集参数“utf-8”,否则后果很严重
Cookie remnameC = new Cookie(“remname”, URLEncoder.encode(user.getUsername(),”utf-8”));