赞
踩
Cookie[] cookies = request.getCookies(); String token = ""; for (Cookie cookie : cookies) { switch(cookie.getName()){ case "token": token = cookie.getValue(); break; default: break; } }
java后台从request获取cookie,获取的应该是一个数组,通过遍历数组来获取我们需要的值;
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。