Class CookieServerRequestCache
java.lang.Object
org.springframework.security.web.server.savedrequest.CookieServerRequestCache
- All Implemented Interfaces:
- ServerRequestCache
An implementation of 
ServerRequestCache that saves the requested URI in a
 cookie.- Since:
- 5.4
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionreactor.core.publisher.Mono<URI>getRedirectUri(org.springframework.web.server.ServerWebExchange exchange) Get the URI that can be redirected to trigger the saved request to be usedreactor.core.publisher.Mono<org.springframework.http.server.reactive.ServerHttpRequest>removeMatchingRequest(org.springframework.web.server.ServerWebExchange exchange) If the providedServerWebExchangematches the savedServerHttpRequestgets the savedServerHttpRequestreactor.core.publisher.Mono<Void>saveRequest(org.springframework.web.server.ServerWebExchange exchange) Save theServerHttpRequestvoidsetCookieCustomizer(Consumer<org.springframework.http.ResponseCookie.ResponseCookieBuilder> cookieCustomizer) Sets theConsumer, allowing customization of cookie.voidsetSaveRequestMatcher(ServerWebExchangeMatcher saveRequestMatcher) Sets the matcher to determine if the request should be saved.
- 
Constructor Details- 
CookieServerRequestCachepublic CookieServerRequestCache()
 
- 
- 
Method Details- 
setSaveRequestMatcherSets the matcher to determine if the request should be saved. The default is to match on any GET request.- Parameters:
- saveRequestMatcher- the- ServerWebExchangeMatcherthat determines if the request should be saved
 
- 
saveRequestpublic reactor.core.publisher.Mono<Void> saveRequest(org.springframework.web.server.ServerWebExchange exchange) Description copied from interface:ServerRequestCacheSave theServerHttpRequest- Specified by:
- saveRequestin interface- ServerRequestCache
- Parameters:
- exchange- the exchange to save
- Returns:
- Return a Mono<Void>which only replays complete and error signals from thisMono.
 
- 
getRedirectUripublic reactor.core.publisher.Mono<URI> getRedirectUri(org.springframework.web.server.ServerWebExchange exchange) Description copied from interface:ServerRequestCacheGet the URI that can be redirected to trigger the saved request to be used- Specified by:
- getRedirectUriin interface- ServerRequestCache
- Parameters:
- exchange- the exchange to obtain the saved- ServerHttpRequestfrom
- Returns:
- the URI that can be redirected to trigger the saved request to be used
 
- 
removeMatchingRequestpublic reactor.core.publisher.Mono<org.springframework.http.server.reactive.ServerHttpRequest> removeMatchingRequest(org.springframework.web.server.ServerWebExchange exchange) Description copied from interface:ServerRequestCacheIf the providedServerWebExchangematches the savedServerHttpRequestgets the savedServerHttpRequest- Specified by:
- removeMatchingRequestin interface- ServerRequestCache
- Parameters:
- exchange- the exchange to obtain the request from
- Returns:
- the ServerHttpRequest
 
- 
setCookieCustomizerpublic void setCookieCustomizer(Consumer<org.springframework.http.ResponseCookie.ResponseCookieBuilder> cookieCustomizer) Sets theConsumer, allowing customization of cookie.- Parameters:
- cookieCustomizer- customize for cookie
- Since:
- 6.4
 
 
-