当前位置 : 主页 > 编程语言 > java >

jsp – 用于重置会话的JSF按钮

来源:互联网 收集:自由互联 发布时间:2021-06-25
有没有办法在用户点击按钮时重置(清除)用户的会话? 关于什么 session.invalidate(); invalidate method of session object is used to discard the session and releases any objects stored as attributes. This method helps t
有没有办法在用户点击按钮时重置(清除)用户的会话? 关于什么

session.invalidate();

invalidate method of session object is
used to discard the session and
releases any objects stored as
attributes. This method helps to
reduce memory overhead and achieves
improvement in performance. It is
always a good practice to explicitly
remove or invalidate sessions using
session.invalidate() method.

要么

session.removeAttribute(String)

The removeAttribute method of session object is used to remove the attribute and value from the session.

网友评论