传统 SESSION 式
@RequestMapping(path = "/login")
public String login(String uname, HttpSession httpSession) {
httpSession.setAttribute("name", uname);
return "欢迎登录:" + uname;
}
@RequestMapping(path = "/get")
public String get(String uname, HttpSession httpSession) {
return "获取session:" + httpSession.getAttribute("name");
}
2024/5/1...大约 2 分钟