To implement the Logout feature we need to define the logout element under the HTTP element, so spring security will automatically add a filter logoutfilter to Filterchain for us to handle the exit login. When we specify that the HTTP element's Auto-config property is true, the logout definition is automatically configured, at which point we exit the login by default with the URL "/j_spring_security_logout", You can change the default address of the exit login by logout The Logout-url property of the element.
<security:logout logout-url= "/logout.do"/>
In addition, we can also specify the following properties for logout:
Property name |
function |
Invalidate-session |
Indicates whether to invalidate the current session after exiting the login, which defaults to true. |
Delete-cookies |
Specifies the name of the cookie that needs to be deleted after logging out, with multiple cookies separated by commas. |
Logout-success-url |
Specifies the URL to redirect after successfully exiting the login. It is important to note that the corresponding URL should be accessible without having to log in. |
Success-handler-ref |
Specifies a reference to handle the Logoutsuccesshandler that successfully exited the login. |
(Note: This article is written based on spring Security3.1.6)
(Note: Original article, reproduced please indicate the source.) Original address: http://haohaoxuexi.iteye.com/blog/2162334)