怎么把电脑上登录的用户信息存在cookie里面,在下次打开登陆页面的时候方便检索历史登录过的用户名 求高人指导,不胜感激
------解决方案--------------------------------------------------------
- Java code
public String execute() throws Exception{ Cookie cookie = new Cookie("user",getUsername()); cookie.setMaxAge(60*60); response.addCookie(cookie); return "cook"; }