修改cookie里的httpOnly为false

tech2023-02-08  110

HttpServletResponse response = HttpContextUtils.getHttpServletResponse(); // 去掉cookie的httpOnly 让js可以获取cookie String header = response.getHeader("Set-Cookie"); int index; if(header !=null && (index = header.indexOf("HttpOnly"))>0) { header = header.substring(0,index - 1); response.setHeader("Set-Cookie",header); }
最新回复(0)