HttpSession session = req.getSession();
session.setAttribute("name",username);
Cookie cookie = new Cookie("JSESSIONID",session.getId());
cookie.setMaxAge(60*60*24*7);
session.setMaxInactiveInterval(60*60*24*7);
resp.addCookie(cookie);
七天免登录
最新推荐文章于 2023-03-21 15:59:36 发布