You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Delete WebSessionStoreReactiveSessionRegistry.java and gives the responsibility to remove the sessions from the WebSessionStore to the handler
Issue gh-6192
@@ -238,8 +239,8 @@ open fun springSecurity(http: ServerHttpSecurity): SecurityWebFilterChain {
238
239
}
239
240
240
241
@Bean
241
-
open fun reactiveSessionRegistry(webSessionManager: WebSessionManager): ReactiveSessionRegistry {
242
-
return WebSessionStoreReactiveSessionRegistry((webSessionManager as DefaultWebSessionManager).sessionStore)
242
+
open fun reactiveSessionRegistry(): ReactiveSessionRegistry {
243
+
return InMemoryReactiveSessionRegistry()
243
244
}
244
245
----
245
246
======
@@ -248,15 +249,8 @@ open fun reactiveSessionRegistry(webSessionManager: WebSessionManager): Reactive
248
249
== Specifying a `ReactiveSessionRegistry`
249
250
250
251
In order to keep track of the user's sessions, Spring Security uses a {security-api-url}org/springframework/security/core/session/ReactiveSessionRegistry.html[ReactiveSessionRegistry], and, every time a user logs in, their session information is saved.
251
-
Typically, in a Spring WebFlux application, you will use the {security-api-url}/org/springframework/security/web/session/WebSessionStoreReactiveSessionRegistry.html[WebSessionStoreReactiveSessionRegistry] which makes sure that the `WebSession` is invalidated whenever the `ReactiveSessionInformation` is invalidated.
252
-
253
-
Spring Security ships with {security-api-url}/org/springframework/security/web/session/WebSessionStoreReactiveSessionRegistry.html[WebSessionStoreReactiveSessionRegistry] and {security-api-url}org/springframework/security/core/session/InMemoryReactiveSessionRegistry.html[InMemoryReactiveSessionRegistry] implementations of `ReactiveSessionRegistry`.
254
252
255
-
[NOTE]
256
-
====
257
-
When creating the `WebSessionStoreReactiveSessionRegistry`, you need to provide the `WebSessionStore` that is being used by your application.
258
-
If you are using Spring WebFlux, you can use the `WebSessionManager` bean (which is usually an instance of `DefaultWebSessionManager`) to get the `WebSessionStore`.
259
-
====
253
+
Spring Security ships with {security-api-url}org/springframework/security/core/session/InMemoryReactiveSessionRegistry.html[InMemoryReactiveSessionRegistry] implementation of `ReactiveSessionRegistry`.
260
254
261
255
To specify a `ReactiveSessionRegistry` implementation you can either declare it as a bean:
@@ -355,7 +349,7 @@ open fun springSecurity(http: ServerHttpSecurity): SecurityWebFilterChain {
355
349
356
350
At times, it is handy to be able to invalidate all or some of a user's sessions.
357
351
For example, when a user changes their password, you may want to invalidate all of their sessions so that they are forced to log in again.
358
-
To do that, you can use the `ReactiveSessionRegistry` bean to retrieve all the user's sessionsand then invalidate them:
352
+
To do that, you can use the `ReactiveSessionRegistry` bean to retrieve all the user's sessions, invalidate them, and them remove them from the `WebSessionStore`:
359
353
360
354
.Using ReactiveSessionRegistry to invalidate sessions manually
361
355
[tabs]
@@ -367,13 +361,12 @@ Java::
367
361
public class SessionControl {
368
362
private final ReactiveSessionRegistry reactiveSessionRegistry;
369
363
370
-
public SessionControl(ReactiveSessionRegistry reactiveSessionRegistry) {
0 commit comments