From 2f280b01e1622068d044052596fb07828fdeffaf Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 3 Nov 2020 19:42:57 +0000 Subject: [PATCH] Improve Spring Session back-off documentation Closes gh-23151 --- .../src/main/asciidoc/spring-boot-features.adoc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc index 23be0f2785..f17f52ad3d 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc @@ -5922,11 +5922,15 @@ When building a Servlet web application, the following stores can be auto-config * Hazelcast * MongoDB +The Servlet auto-configuration replaces the need to use `@Enable*HttpSession`. + When building a reactive web application, the following stores can be auto-configured: * Redis * MongoDB +The reactive auto-configuration replaces the need to use `@Enable*WebSession`. + 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, you must choose the {spring-boot-autoconfigure-module-code}/session/StoreType.java[`StoreType`] that you wish to use to store the sessions. For instance, to use JDBC as the back-end store, you can configure your application as follows: @@ -5949,6 +5953,10 @@ For instance, it is possible to customize the name of the table for the JDBC sto For setting the timeout of the session you can use the configprop:spring.session.timeout[] property. If that property is not set, the auto-configuration falls back to the value of configprop:server.servlet.session.timeout[]. +You can take control over Spring Session's configuration using `@Enable*HttpSession` (Servlet) or `@Enable@WebSession` (Reactive). +This will cause the auto-configuratio to back off. +Spring Session can then be configured using the annotation's attributes rather than the previously described configuration properties. + [[boot-features-jmx]]