Class CookieClearingLogoutHandler
java.lang.Object
org.springframework.security.web.authentication.logout.CookieClearingLogoutHandler
- All Implemented Interfaces:
LogoutHandler
A logout handler which clears either - A defined list of cookie names, using the
context path as the cookie path OR - A given list of Cookies
- Since:
- 3.1
-
Constructor Summary
ConstructorDescriptionCookieClearingLogoutHandler
(jakarta.servlet.http.Cookie... cookiesToClear) CookieClearingLogoutHandler
(String... cookiesToClear) -
Method Summary
Modifier and TypeMethodDescriptionvoid
logout
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Authentication authentication) Causes a logout to be completed.
-
Constructor Details
-
CookieClearingLogoutHandler
-
CookieClearingLogoutHandler
public CookieClearingLogoutHandler(jakarta.servlet.http.Cookie... cookiesToClear) - Parameters:
cookiesToClear
- - One or more Cookie objects that must have maxAge of 0- Since:
- 5.2
-
-
Method Details
-
logout
public void logout(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Authentication authentication) Description copied from interface:LogoutHandler
Causes a logout to be completed. The method must complete successfully.- Specified by:
logout
in interfaceLogoutHandler
- Parameters:
request
- the HTTP requestresponse
- the HTTP responseauthentication
- the current principal details
-