//判断是否重复添加过此ID
String[] listArr = list.split("K");
Boolean Flag = true;
for(String arr:listArr){
if(arr.equals(String.valueOf(id))){cookieAddFlag = false;}
}
if(Flag){
list += String.valueOf(id)+"K";
Cookie historyCookie = new Cookie("history",list);
response.addCookie(historyCookie);
}
String[] listArr = list.split("K");
Boolean Flag = true;
for(String arr:listArr){
if(arr.equals(String.valueOf(id))){cookieAddFlag = false;}
}
if(Flag){
list += String.valueOf(id)+"K";
Cookie historyCookie = new Cookie("history",list);
response.addCookie(historyCookie);
}
2021-02-24