mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-17 12:09:16 +00:00
Merge branch '4.0.x'
Closes gh-49705
This commit is contained in:
+7
-13
@@ -2,23 +2,16 @@
|
||||
= Spring Session
|
||||
|
||||
Spring Boot provides {url-spring-session-site}[Spring Session] auto-configuration for a range of data stores.
|
||||
For each data store, a specific Spring Boot starter is provided.
|
||||
|
||||
When building a servlet web application, the following stores can be auto-configured:
|
||||
|
||||
* Redis
|
||||
* JDBC
|
||||
|
||||
Additionally, {url-spring-boot-for-apache-geode-site}[Spring Boot for Apache Geode] provides {url-spring-boot-for-apache-geode-docs}#geode-session[auto-configuration for using Apache Geode as a session store].
|
||||
* Redis (`spring-boot-starter-session-data-redis`)
|
||||
* JDBC (`spring-boot-starter-session-jdbc`)
|
||||
|
||||
The servlet auto-configuration replaces the need to use `@Enable*HttpSession`.
|
||||
|
||||
If a single Spring Session module is present on the classpath, Spring Boot uses that store implementation automatically.
|
||||
If you have more than one implementation, Spring Boot uses the following order for choosing a specific implementation:
|
||||
|
||||
. Redis
|
||||
. JDBC
|
||||
. If neither Redis nor JDBC are available, we do not configure a javadoc:org.springframework.session.SessionRepository[].
|
||||
|
||||
When building a reactive web application, the Redis store can be auto-configured.
|
||||
When building a reactive web application, the Redis store can be auto-configured by depending on `spring-boot-starter-session-data-redis`.
|
||||
This replaces the need to use `@EnableRedisWebSession`.
|
||||
|
||||
Each store has specific additional settings.
|
||||
@@ -37,4 +30,5 @@ If that property is not set with a servlet web application, the auto-configurati
|
||||
|
||||
You can take control over Spring Session's configuration using `@Enable*HttpSession` (servlet) or `@EnableRedisWebSession` (reactive).
|
||||
This will cause the auto-configuration to back off.
|
||||
Spring Session can then be configured using the annotation's attributes rather than the previously described configuration properties.
|
||||
Alternatively, depend on the relevant Spring Session module directly rather than using one of Spring Boot's starters for Spring Session.
|
||||
With either approach, Spring Session can then be configured using the annotation's attributes rather than the previously described configuration properties.
|
||||
|
||||
Reference in New Issue
Block a user