servlets如何用java编写注销代码
这是我的密码:
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
HttpSession session = request.getSession(false);
if (session != null) {
session.removeAttribute("FirstName");
session.removeAttribute("pwd");
session.invalidate();
}
response.sendRedirect("index.html");
}
}
在这之后我能做什么? 任何帮助都将不胜感激
# 1 楼答案
我认为使用Cookies注销会更好。。Cookies的代码是: