系统调试,后台获取不到手机端浏览器打开网页的cookies,是手机浏览器不支持吗?还是我代码有问题
哪位大哥了解,咨询下
String value = null;
Cookie[] cookies = request.getCookies();
if (cookies != null) {
for (Cookie cookie : cookies) {
log.debug("cookie name------------"+cookie.getName());
log.debug("cookie value------------"+cookie.getValue());
if (cookie.getName().equals(name)) {
try {
value = URLDecoder.decode(cookie.getValue(), "utf-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
if (isRemove) {
cookie.setMaxAge(0);
response.addCookie(cookie);
}
}
}
}
return value;