获取cookies的简单代码(总结待续)
Cookie[] cookies = request.getCookies(); Cookie cookie = null; for (int i = 0; i < cookies.length; i++) { cookie = cookies[i]; if (cookie.getName().equals("username")) { out.println("用户名:" + cookie.getValue()); } if (cookie.getName().equals("lastTime")) { out.println("上次登录时间:" + cookie.getValue()); } }
待续……