在Controller层里加上1234567/** * 设置HttpOnly=true,SameSite=secure,Secure=true */@ModelAttributepublic void setReqAndRes(HttpServletRequest request, HttpServletResponse response){ response.setHeader("Set-Cookie", response.getHeader("Set-Cookie")+";SameSite=strict;HttpOnly;Secure=true");}