记住我一周免登陆实现
private void addCookie(HttpServletResponse response ,String username,String password)
{
Cookie name = new Cookie("userName", username);
Cookie pwd = new Cookie("password", password);
//cookie存在7天
name.setMaxAge(7*24*60*60);
pwd.setMaxAge(7*24*60*60);
response.addCookie(name);
response.addCookie(pwd);
}