diff --git a/docs/spring-cloud-data-flow/spring-cloud-dataflow.md b/docs/spring-cloud-data-flow/spring-cloud-dataflow.md
index d2ea9cab7bb561212fbf4828a79c8f27b217ba9a..0896b2b69c0e53393075730d79e12f24569acbf9 100644
--- a/docs/spring-cloud-data-flow/spring-cloud-dataflow.md
+++ b/docs/spring-cloud-data-flow/spring-cloud-dataflow.md
@@ -12316,6 +12316,4 @@ spring:
provider:
azure:
issuer-uri: https://login.microsoftonline.com/799dcfde-b9e3-4dfc-ac25-659b326e0bcd/v2.0
-```
-
-最近更新时间:2022-01-18 18:55:25UTC
+```
\ No newline at end of file
diff --git a/docs/spring-session/api.md b/docs/spring-session/api.md
index 31679a031068cb10a77a0de044b7ae7dfb3abb6c..7444404cffc99789aac858324360f0f2e6c67596 100644
--- a/docs/spring-session/api.md
+++ b/docs/spring-session/api.md
@@ -84,7 +84,7 @@ Spring 使用`Session`的会话最基本的 API 是`SessionRepository`。这个
一些`SessionRepository`实现方式也可以选择实现`FindByIndexNameSessionRepository`。例如, Spring 的 Redis、JDBC 和 Hazelcast 支持库都实现了`FindByIndexNameSessionRepository`。
-`FindByIndexNameSessionRepository`提供了一个方法来查找具有给定的索引名和索引值的所有会话。作为所有提供的`FindByIndexNameSessionRepository`实现所支持的通用用例,你可以使用一种方便的方法来查找特定用户的所有会话。这是通过确保将名称为`FindByIndexNameSessionRepository.PRINCIPAL_NAME_INDEX_NAME`的会话属性填充为用户名来完成的。你有责任确保填充该属性,因为 Spring 会话不知道正在使用的身份验证机制。下面的清单中可以看到如何使用该方法的示例:
+`FindByIndexNameSessionRepository`提供了一个方法来查找具有给定的索引名和索引值的所有会话。作为所有提供的`FindByIndexNameSessionRepository`实现所支持的通用用例,你可以使用一种方便的方法来查找特定用户的所有会话。这是通过确保将名称为`FindByIndexNameSessionRepository.PRINCIPAL_NAME_INDEX_NAME`的会话属性填充为用户名来完成的。你有责任确保填充该属性,因为 Spring Session 不知道正在使用的身份验证机制。下面的清单中可以看到如何使用该方法的示例:
```
String username = "username";
@@ -244,7 +244,7 @@ EXPIRE spring:session:sessions:33fdd1b6-b496-4b33-9f7d-df96679d32fe 2100
| |`SessionRepository.findById(String)`方法确保不返回过期的会话。 这意味着在使用会话之前不需要检查过期。|
|---|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-Spring 会话依赖于从 Redis 中删除和过期的[键位通知](https://redis.io/topics/notifications)来发射一个[`SessionDeletedEvent`](#api-redinidexedsessionRepository-sessionDestroyedEvent)和一个[ ](#api-redinidexedsessionRepository-sessionDestroyedEvent)。 或 确保清理与 相关的资源。例如,当你使用 Spring 会话的 WebSocket 支持时,Redis 过期或删除事件将触发与会话相关的任何 WebSocket 连接以关闭。
+Spring Session 依赖于从 Redis 中删除和过期的[键位通知](https://redis.io/topics/notifications)来发射一个[`SessionDeletedEvent`](#api-redinidexedsessionRepository-sessionDestroyedEvent)和一个[ ](#api-redinidexedsessionRepository-sessionDestroyedEvent)。 或 确保清理与 相关的资源。例如,当你使用 Spring Session 的 WebSocket 支持时,Redis 过期或删除事件将触发与会话相关的任何 WebSocket 连接以关闭。
不会在会话密钥本身上直接跟踪过期,因为这将意味着会话数据将不再可用。相反,使用了一个特殊的会话过期键.在前面的示例中,Expires 键如下:
@@ -285,7 +285,7 @@ EXPIRE spring:session:expirations1439245080000 2100
redis-cli config set notify-keyspace-events Egx
```
-如果使用`@EnableRedisHttpSession`,那么管理`SessionMessageListener`并启用必要的 Redis 密钥空间事件将自动完成。但是,在一个安全的 Redis 环境中,config 命令是禁用的。这意味着 Spring 会话不能为你配置 Redis Keyspace 事件。若要禁用自动配置,请将`ConfigureRedisAction.NO_OP`添加为 Bean。
+如果使用`@EnableRedisHttpSession`,那么管理`SessionMessageListener`并启用必要的 Redis 密钥空间事件将自动完成。但是,在一个安全的 Redis 环境中,config 命令是禁用的。这意味着 Spring Session 不能为你配置 Redis Keyspace 事件。若要禁用自动配置,请将`ConfigureRedisAction.NO_OP`添加为 Bean。
例如,对于 Java 配置,你可以使用以下方法:
@@ -320,7 +320,7 @@ redis 127.0.0.1:6379> keys *
2) "spring:session:expirations:1418772300000" (2)
```
-|**1**|此键的后缀是 Spring 会话的会话标识符。|
+|**1**|此键的后缀是 Spring Session 的会话标识符。|
|-----|-----------------------------------------------------------------------------------------|
|**2**|此键包含在`1418772300000`时应删除的所有会话 ID。|
@@ -379,7 +379,7 @@ redis 127.0.0.1:6379> keys *
1) "spring:session:sessions:4fc39ce3-63b3-4e17-b1c4-5e1ed96fb021" (1)
```
-|**1**|此键的后缀是 Spring 会话的会话标识符。|
+|**1**|此键的后缀是 Spring Session 的会话标识符。|
|-----|-----------------------------------------------------------------------|
你还可以使用`hkeys`命令查看每个会话的属性。下面的示例展示了如何做到这一点:
@@ -406,7 +406,7 @@ redis 127.0.0.1:6379> hget spring:session:sessions:4fc39ce3-63b3-4e17-b1c4-5e1ed
SessionRepository extends Session> repository = new MapSessionRepository(new ConcurrentHashMap<>());
```
-### [](#api-mapsessionrepository-hazelcast)使用 Spring 会话和 hazlecast
+### [](#api-mapsessionrepository-hazelcast)使用 Spring Session 和 hazlecast
[Hazelcast 样品](samples.html#samples)是一个完整的应用程序,它演示了如何使用 Spring 与 HazelCast 会话。
@@ -416,7 +416,7 @@ SessionRepository extends Session> repository = new MapSessionRepository(new C
./gradlew :samples:hazelcast:tomcatRun
```
-[Hazelcast Spring Sample](samples.html#samples)是一个完整的应用程序,它演示了如何使用 Spring 会话与 Spring 安全性。
+[Hazelcast Spring Sample](samples.html#samples)是一个完整的应用程序,它演示了如何使用 Spring Session 与 Spring 安全性。
它包括支持发射`SessionCreatedEvent`、`SessionDeletedEvent`和`SessionExpiredEvent`的示例 HazelCast`MapListener`实现。
@@ -457,7 +457,7 @@ SessionRepository extends Session> repository = new JdbcIndexedSessionReposito
在 Web 环境中,创建新的`JdbcIndexedSessionRepository`的最简单方法是使用`@EnableJdbcHttpSession`。你可以在[示例和指南(从这里开始)](samples.html#samples)中找到完整的使用示例,你可以使用以下属性来定制配置:
-* **表格 Name**: Spring 会话用于存储会话的数据库表名称
+* **表格 Name**: Spring Session 用于存储会话的数据库表名称
* **最大活动间隔秒**:会话之前的时间将在几秒内到期
@@ -583,7 +583,7 @@ HazelcastIndexedSessionRepository repository = new HazelcastIndexedSessionReposi
## [](#api-cookieserializer)使用`CookieSerializer`
-a`CookieSerializer`负责定义会话 cookie 的编写方式。 Spring 会话带有使用`DefaultCookieSerializer`的默认实现。
+a`CookieSerializer`负责定义会话 cookie 的编写方式。 Spring Session 带有使用`DefaultCookieSerializer`的默认实现。
### [](#api-cookieserializer-bean)将`CookieSerializer`暴露为 Bean
@@ -635,8 +635,8 @@ a`CookieSerializer`负责定义会话 cookie 的编写方式。 Spring 会话带
## [](#custom-sessionrepository)自定义`SessionRepository`
-实现自定义[`SessionRepository`](#API-SessionRepository)API 应该是一项相当简单的任务。将自定义实现与[`@EnableSpringHttpSession`](#api-enablespringhtpsession)支持相耦合,可以重用现有的 Spring 会话配置设施和基础设施。然而,有几个方面值得更仔细地考虑。
+实现自定义[`SessionRepository`](#API-SessionRepository)API 应该是一项相当简单的任务。将自定义实现与[`@EnableSpringHttpSession`](#api-enablespringhtpsession)支持相耦合,可以重用现有的 Spring Session 配置设施和基础设施。然而,有几个方面值得更仔细地考虑。
-在 HTTP 请求的生命周期中,`HttpSession`通常会两次持久化到`SessionRepository`。第一个持久化操作是确保一旦客户端访问了会话 ID,会话对客户端是可用的,并且还需要在会话提交后写入,因为可能会对会话进行进一步的修改。考虑到这一点,我们通常建议`SessionRepository`实现跟踪更改,以确保只保存增量。这在高度并发的环境中尤其重要,在这种环境中,多个请求在同一个`HttpSession`上运行,因此会导致竞争条件,因为请求会覆盖彼此对会话属性的更改。 Spring 会话提供的所有`SessionRepository`实现都使用所描述的方法来持久化会话更改,并且可以在实现自定义`SessionRepository`时用于指导。
+在 HTTP 请求的生命周期中,`HttpSession`通常会两次持久化到`SessionRepository`。第一个持久化操作是确保一旦客户端访问了会话 ID,会话对客户端是可用的,并且还需要在会话提交后写入,因为可能会对会话进行进一步的修改。考虑到这一点,我们通常建议`SessionRepository`实现跟踪更改,以确保只保存增量。这在高度并发的环境中尤其重要,在这种环境中,多个请求在同一个`HttpSession`上运行,因此会导致竞争条件,因为请求会覆盖彼此对会话属性的更改。 Spring Session 提供的所有`SessionRepository`实现都使用所描述的方法来持久化会话更改,并且可以在实现自定义`SessionRepository`时用于指导。
请注意,同样的建议也适用于实现自定义[`ReactiveSessionRepository`](#API-reactivesessionRepository)。在这种情况下,你应该使用[`@EnableSpringWebSession`]。
\ No newline at end of file
diff --git a/docs/spring-session/boot-findbyusername.md b/docs/spring-session/boot-findbyusername.md
index 1e1164fa043d7d2de665253613c28e426dd71b21..98f0e19574413de150ec0bef77500a570dc5bf2d 100644
--- a/docs/spring-session/boot-findbyusername.md
+++ b/docs/spring-session/boot-findbyusername.md
@@ -1,6 +1,6 @@
-# Spring 会话-按用户名查找
+# Spring Session-按用户名查找
-本指南描述了如何使用 Spring 会话通过用户名查找会话。
+本指南描述了如何使用 Spring Session 通过用户名查找会话。
| |你可以在[FindByUserName 应用程序](#findbyusername-sample)中找到完整的指南。|
|---|---------------------------------------------------------------------------------------------|
@@ -9,9 +9,9 @@
## [](#findbyusername-assumptions)假设
-该指南假定你已经通过使用内置的 Redis 配置支持向应用程序添加了 Spring 会话。该指南还假定你已经对应用程序应用了 Spring 安全性。然而,我们的指南是有点通用的目的,可以应用于任何技术,只需最小的变化,这一点我们将在后面的指南中进行讨论。
+该指南假定你已经通过使用内置的 Redis 配置支持向应用程序添加了 Spring Session 。该指南还假定你已经对应用程序应用了 Spring 安全性。然而,我们的指南是有点通用的目的,可以应用于任何技术,只需最小的变化,这一点我们将在后面的指南中进行讨论。
-| |如果需要学习如何将 Spring 会话添加到项目中,请参见[样本和指南](../#samples)列表|
+| |如果需要学习如何将 Spring Session 添加到项目中,请参见[样本和指南](../#samples)列表|
|---|--------------------------------------------------------------------------------------------------------------------|
## [](#_about_the_sample)关于样本
@@ -32,7 +32,7 @@
## [](#_mapping_the_user_name)映射用户名
-`FindByIndexNameSessionRepository`如果开发人员指示 Spring 会话什么用户与`Session`相关联,则只能通过用户名找到会话。你可以通过确保将名称`FindByUsernameSessionRepository.PRINCIPAL_NAME_INDEX_NAME`的会话属性填充为用户名来做到这一点。
+`FindByIndexNameSessionRepository`如果开发人员指示 Spring Session 什么用户与`Session`相关联,则只能通过用户名找到会话。你可以通过确保将名称`FindByUsernameSessionRepository.PRINCIPAL_NAME_INDEX_NAME`的会话属性填充为用户名来做到这一点。
一般来说,你可以在用户进行身份验证后立即使用以下代码来完成此操作:
@@ -103,7 +103,7 @@ public void doFilterInternal(HttpServletRequest request, HttpServletResponse res
我们获得我们想要的信息,然后将`SessionDetails`设置为`Session`中的一个属性。当我们通过用户名检索`Session`时,我们可以使用会话来访问我们的`SessionDetails`,就像我们将访问任何其他会话属性一样。
-| |你可能想知道为什么 Spring 会话没有提供`SessionDetails`开箱即用的功能。 我们有两个原因。 第一个原因是应用程序自己实现这一点是非常琐碎的。 第二个原因是信息会话中填充的内容(以及信息更新的频率)高度依赖于应用程序。|
+| |你可能想知道为什么 Spring Session 没有提供`SessionDetails`开箱即用的功能。 我们有两个原因。 第一个原因是应用程序自己实现这一点是非常琐碎的。 第二个原因是信息会话中填充的内容(以及信息更新的频率)高度依赖于应用程序。|
|---|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
## [](#_finding_sessions_for_a_specific_user)查找特定用户的会话
diff --git a/docs/spring-session/boot-jdbc.md b/docs/spring-session/boot-jdbc.md
index 93dbb80d7bb3ee8ad4202aa48fe5ecaa575617b0..6d18915e22c3f6582e206c10067cc5d52c314c83 100644
--- a/docs/spring-session/boot-jdbc.md
+++ b/docs/spring-session/boot-jdbc.md
@@ -1,6 +1,6 @@
-# Spring 会话- Spring 启动
+# Spring Session- Spring 启动
-本指南描述了在使用 Spring 引导时如何使用 Spring 会话来透明地利用关系数据库来支持 Web 应用程序的`HttpSession`。
+本指南描述了在使用 Spring 引导时如何使用 Spring Session 来透明地利用关系数据库来支持 Web 应用程序的`HttpSession`。
| |你可以在[httpsession-jdbc-boot 示例应用程序](#httpsession-jdbc-boot-sample)中找到完整的指南。|
|---|------------------------------------------------------------------------------------------------------------------|
@@ -9,7 +9,7 @@
## [](#_updating_dependencies)更新依赖项
-在使用 Spring 会话之前,你必须更新你的依赖关系。我们假设你正在使用一个有效的启动 Web 应用程序。如果使用 Maven,则必须添加以下依赖项:
+在使用 Spring Session 之前,你必须更新你的依赖关系。我们假设你正在使用一个有效的启动 Web 应用程序。如果使用 Maven,则必须添加以下依赖项:
POM.xml
@@ -24,11 +24,11 @@ POM.xml
```
-Spring 启动为 Spring 会话模块提供了依赖管理,因此不需要显式地声明依赖版本。
+Spring 启动为 Spring Session 模块提供了依赖管理,因此不需要显式地声明依赖版本。
## [](#httpsession-jdbc-boot-spring-configuration) Spring 引导配置
-在添加了所需的依赖项之后,我们就可以创建我们的 Spring 启动配置了。多亏了一流的自动配置支持,在关系数据库支持下设置 Spring 会话就像在`application.properties`中添加一个配置属性一样简单。下面的清单展示了如何做到这一点:
+在添加了所需的依赖项之后,我们就可以创建我们的 Spring 启动配置了。多亏了一流的自动配置支持,在关系数据库支持下设置 Spring Session 就像在`application.properties`中添加一个配置属性一样简单。下面的清单展示了如何做到这一点:
SRC/主/资源/应用程序.properties
@@ -36,9 +36,9 @@ SRC/主/资源/应用程序.properties
spring.session.store-type=jdbc # Session store type.
```
-如果在 Classpath 上存在单个 Spring 会话模块,则 Spring 引导将自动使用该存储实现。如果有多个实现,则必须选择要用来存储会话的 StoreType,如上面所示。
+如果在 Classpath 上存在单个 Spring Session 模块,则 Spring 引导将自动使用该存储实现。如果有多个实现,则必须选择要用来存储会话的 StoreType,如上面所示。
-在这种情况下, Spring boot 应用的配置相当于手动添加`@EnableJdbcHttpSession`注释。这将创建一个名为`springSessionRepositoryFilter`的 Spring Bean。 Bean 实现`Filter`。过滤器负责替换要由 Spring 会话支持的`HttpSession`实现。
+在这种情况下, Spring boot 应用的配置相当于手动添加`@EnableJdbcHttpSession`注释。这将创建一个名为`springSessionRepositoryFilter`的 Spring Bean。 Bean 实现`Filter`。过滤器负责替换要由 Spring Session 支持的`HttpSession`实现。
你可以使用`application.properties`来进一步自定义。下面的清单展示了如何做到这一点:
@@ -55,7 +55,7 @@ spring.session.jdbc.table-name=SPRING_SESSION # Name of the database table used
## [](#httpsession-jdbc-boot-configuration)配置`DataSource`
-Spring 引导会自动创建一个`DataSource`,它将 Spring 会话连接到 H2 数据库的嵌入式实例。在生产环境中,你需要更新配置以指向关系数据库。例如,你可以在应用程序中包含以下内容:
+Spring 引导会自动创建一个`DataSource`,它将 Spring Session 连接到 H2 数据库的嵌入式实例。在生产环境中,你需要更新配置以指向关系数据库。例如,你可以在应用程序中包含以下内容:
SRC/主/资源/应用程序.properties
@@ -69,13 +69,13 @@ spring.datasource.password= # Login password of the database.
## [](#httpsession-jdbc-boot-servlet-configuration) Servlet 容器初始化
-我们的[Spring Boot Configuration](#httpsession-jdbc-boot-spring-configuration)创建了一个名为`springSessionRepositoryFilter`的 Spring Bean,它实现了`Filter`。`springSessionRepositoryFilter` Bean 负责用 Spring 会话支持的自定义实现替换`HttpSession`。
+我们的[Spring Boot Configuration](#httpsession-jdbc-boot-spring-configuration)创建了一个名为`springSessionRepositoryFilter`的 Spring Bean,它实现了`Filter`。`springSessionRepositoryFilter` Bean 负责用 Spring Session 支持的自定义实现替换`HttpSession`。
为了让我们的`Filter`发挥其魔力, Spring 需要加载我们的`Config`类。最后,我们需要确保我们的 Servlet 容器(即 Tomcat)为每个请求使用我们的`springSessionRepositoryFilter`。幸运的是,Boot 为我们解决了这两个步骤。
## [](#httpsession-jdbc-boot-sample)`httpsession-jdbc-boot`示例应用程序
-HttpSession-JDBC-Boot 示例应用程序演示了如何在使用 Spring 引导时使用 Spring 会话透明地利用 H2 数据库来支持 Web 应用程序的`HttpSession`。
+HttpSession-JDBC-Boot 示例应用程序演示了如何在使用 Spring 引导时使用 Spring Session 透明地利用 H2 数据库来支持 Web 应用程序的`HttpSession`。
### [](#httpsession-jdbc-boot-running)运行`httpsession-jdbc-boot`示例应用程序
@@ -99,9 +99,9 @@ $ ./gradlew :spring-session-sample-boot-jdbc:bootRun
### [](#httpsession-jdbc-boot-how)它是如何工作的?
-我们不使用 Tomcat 的`HttpSession`,而是将这些值保存在 H2 数据库中。 Spring 会话使用由关系数据库支持的实现来替换`HttpSession`。当 Spring Security 的`SecurityContextPersistenceFilter`将`SecurityContext`保存到`HttpSession`时,它将被持久化到 H2 数据库中。
+我们不使用 Tomcat 的`HttpSession`,而是将这些值保存在 H2 数据库中。 Spring Session 使用由关系数据库支持的实现来替换`HttpSession`。当 Spring Security 的`SecurityContextPersistenceFilter`将`SecurityContext`保存到`HttpSession`时,它将被持久化到 H2 数据库中。
-当创建一个新的`HttpSession`时, Spring 会话将在浏览器中创建一个名为`SESSION`的 cookie。该 cookie 包含你的会话的 ID。你可以查看 cookies(使用[Chrome](https://developers.google.com/web/tools/chrome-devtools/manage-data/cookies)或[Firefox](https://developer.mozilla.org/en-US/docs/Tools/Storage_Inspector))。
+当创建一个新的`HttpSession`时, Spring Session 将在浏览器中创建一个名为`SESSION`的 cookie。该 cookie 包含你的会话的 ID。你可以查看 cookies(使用[Chrome](https://developers.google.com/web/tools/chrome-devtools/manage-data/cookies)或[Firefox](https://developer.mozilla.org/en-US/docs/Tools/Storage_Inspector))。
你可以通过使用 H2Web 控制台来删除会话:[http://localhost:8080/h2-console/](http://localhost:8080/h2-console/)(对于 JDBC URL 使用`jdbc:h2:mem:testdb`)。
diff --git a/docs/spring-session/boot-mongo.md b/docs/spring-session/boot-mongo.md
index 8c421e92013b38916a3c23145b4e5004db940b74..96e57d56d62d59eea7c58a48a464f883b8385405 100644
--- a/docs/spring-session/boot-mongo.md
+++ b/docs/spring-session/boot-mongo.md
@@ -1,6 +1,6 @@
-# Spring 会话-MongoDB 存储库
+# Spring Session-MongoDB 存储库
-本指南描述了如何使用由 MongoDB 支持的 Spring 会话。
+本指南描述了如何使用由 MongoDB 支持的 Spring Session 。
| |完整的指南可在[Mongo 示例应用程序](#mongo-sample)中找到。|
|---|----------------------------------------------------------------------------------|
@@ -9,7 +9,7 @@
## [](#_updating_dependencies)更新依赖项
-在使用 Spring 会话 MongoDB 之前,必须确保更新依赖项。我们假设你正在使用一个有效的启动 Web 应用程序。如果你正在使用 Maven,请确保添加以下依赖项:
+在使用 Spring Session MongoDB 之前,必须确保更新依赖项。我们假设你正在使用一个有效的启动 Web 应用程序。如果你正在使用 Maven,请确保添加以下依赖项:
POM.xml
@@ -39,7 +39,7 @@ POM.xml
## [](#mongo-spring-configuration) Spring 配置
-在添加了所需的依赖关系之后,我们就可以创建我们的 Spring 配置了。 Spring 配置负责创建一个 Servlet 过滤器,该过滤器将`HttpSession`实现替换为由 Spring 会话支持的实现。
+在添加了所需的依赖关系之后,我们就可以创建我们的 Spring 配置了。 Spring 配置负责创建一个 Servlet 过滤器,该过滤器将`HttpSession`实现替换为由 Spring Session 支持的实现。
你所要做的就是添加以下 Spring 配置:
@@ -61,7 +61,7 @@ public class HttpSessionConfig {
## [](#boot-mongo-configuration)配置 MongoDB 连接
-Spring 引导会自动创建一个`MongoClient`,它将 Spring 会话连接到端口 27017(默认端口)上的 LocalHost 上的 MongoDB 服务器。在生产环境中,你需要确保更新配置以指向 MongoDB 服务器。例如,你可以在**应用程序.属性**中包含以下内容
+Spring 引导会自动创建一个`MongoClient`,它将 Spring Session 连接到端口 27017(默认端口)上的 LocalHost 上的 MongoDB 服务器。在生产环境中,你需要确保更新配置以指向 MongoDB 服务器。例如,你可以在**应用程序.属性**中包含以下内容
SRC/主/资源/应用程序.properties
@@ -75,13 +75,13 @@ spring.data.mongodb.database=prod
## [](#boot-servlet-configuration) Servlet 容器初始化
-我们的[Spring Configuration](#boot-mongo-configuration)创建了一个名为`springSessionRepositoryFilter`的 Spring Bean,它实现了`Filter`。`springSessionRepositoryFilter` Bean 负责用 Spring 会话支持的自定义实现替换`HttpSession`。
+我们的[Spring Configuration](#boot-mongo-configuration)创建了一个名为`springSessionRepositoryFilter`的 Spring Bean,它实现了`Filter`。`springSessionRepositoryFilter` Bean 负责用 Spring Session 支持的自定义实现替换`HttpSession`。
为了让我们的`Filter`发挥其魔力, Spring 需要加载我们的`Config`类。最后,我们需要确保我们的 Servlet 容器(即 Tomcat)对每个请求使用我们的`springSessionRepositoryFilter`。幸运的是,Boot 为我们解决了这两个步骤。
## [](#mongo-sample)MongoDB 示例应用程序
-MongoDB 示例应用程序演示了如何在使用 Spring 引导时使用 Spring 会话透明地利用 MongoDB 来支持 Web 应用程序的`HttpSession`。
+MongoDB 示例应用程序演示了如何在使用 Spring 引导时使用 Spring Session 透明地利用 MongoDB 来支持 Web 应用程序的`HttpSession`。
### [](#mongo-running)运行 MongoDB 示例应用程序
@@ -105,9 +105,9 @@ $ ./gradlew :samples:mongo:bootRun
### [](#mongo-how)它是如何工作的?
-而不是使用 Tomcat 的`HttpSession`,我们实际上是在 Mongo 中持久化这些值。 Spring 会话用 Mongo 支持的实现替换`HttpSession`。当 Spring Security 的`SecurityContextPersistenceFilter`将`SecurityContext`保存到`HttpSession`时,它将被持久化到 Mongo 中。
+而不是使用 Tomcat 的`HttpSession`,我们实际上是在 Mongo 中持久化这些值。 Spring Session 用 Mongo 支持的实现替换`HttpSession`。当 Spring Security 的`SecurityContextPersistenceFilter`将`SecurityContext`保存到`HttpSession`时,它将被持久化到 Mongo 中。
-当创建一个新的`HttpSession`时, Spring 会话将在浏览器中创建一个名为会话的 cookie,其中包含会话的 ID。继续查看 cookies(单击[Chrome](https://developer.chrome.com/devtools/docs/resources#cookies)或[Firefox](https://getfirebug.com/wiki/index.php/Cookies_Panel#Cookies_List)以获取帮助)。
+当创建一个新的`HttpSession`时, Spring Session 将在浏览器中创建一个名为会话的 cookie,其中包含会话的 ID。继续查看 cookies(单击[Chrome](https://developer.chrome.com/devtools/docs/resources#cookies)或[Firefox](https://getfirebug.com/wiki/index.php/Cookies_Panel#Cookies_List)以获取帮助)。
如果你愿意,你可以使用 Mongo 客户机轻松地检查会话。例如,在基于 Linux 的系统上,你可以键入:
diff --git a/docs/spring-session/boot-redis.md b/docs/spring-session/boot-redis.md
index d06652203eaa003d1695177e5023ea6bcc019b96..26b1eeb48dc64762ac1eab48af5f860c7ea188e5 100644
--- a/docs/spring-session/boot-redis.md
+++ b/docs/spring-session/boot-redis.md
@@ -1,6 +1,6 @@
-# Spring 会话- Spring 启动
+# Spring Session- Spring 启动
-本指南描述了在使用 Spring 引导时如何使用 Spring 会话透明地利用 Redis 来支持 Web 应用程序的`HttpSession`。
+本指南描述了在使用 Spring 引导时如何使用 Spring Session 透明地利用 Redis 来支持 Web 应用程序的`HttpSession`。
| |你可以在[引导示例应用程序](#boot-sample)中找到完整的指南。|
|---|--------------------------------------------------------------------------------|
@@ -9,7 +9,7 @@
## [](#_updating_dependencies)更新依赖项
-在使用 Spring 会话之前,你必须确保你的依赖关系。我们假设你正在使用一个有效的启动 Web 应用程序。如果正在使用 Maven,则必须添加以下依赖项:
+在使用 Spring Session 之前,你必须确保你的依赖关系。我们假设你正在使用一个有效的启动 Web 应用程序。如果正在使用 Maven,则必须添加以下依赖项:
POM.xml
@@ -24,11 +24,11 @@ POM.xml
```
-Spring 启动为 Spring 会话模块提供了依赖管理,因此不需要显式声明依赖版本。
+Spring 启动为 Spring Session 模块提供了依赖管理,因此不需要显式声明依赖版本。
## [](#boot-spring-configuration) Spring 引导配置
-在添加了所需的依赖项之后,我们就可以创建我们的 Spring 启动配置了。多亏了一流的自动配置支持,由 Redis 支持的设置 Spring 会话非常简单,只需向你的`application.properties`添加一个配置属性,如以下清单所示:
+在添加了所需的依赖项之后,我们就可以创建我们的 Spring 启动配置了。多亏了一流的自动配置支持,由 Redis 支持的设置 Spring Session 非常简单,只需向你的`application.properties`添加一个配置属性,如以下清单所示:
SRC/主/资源/应用程序.properties
@@ -36,7 +36,7 @@ SRC/主/资源/应用程序.properties
spring.session.store-type=redis # Session store type.
```
-在这种情况下, Spring boot 应用的配置相当于手动添加`@EnableRedisHttpSession`注释。这将创建一个名为`springSessionRepositoryFilter`的 Spring Bean,实现`Filter`。过滤器负责替换要由 Spring 会话支持的`HttpSession`实现。
+在这种情况下, Spring boot 应用的配置相当于手动添加`@EnableRedisHttpSession`注释。这将创建一个名为`springSessionRepositoryFilter`的 Spring Bean,实现`Filter`。过滤器负责替换要由 Spring Session 支持的`HttpSession`实现。
使用`application.properties`还可以进行进一步的定制,如以下清单所示:
@@ -52,7 +52,7 @@ spring.session.redis.namespace=spring:session # Namespace for keys used to store
## [](#boot-redis-configuration)配置 Redis 连接
-Spring 启动会自动创建一个`RedisConnectionFactory`,它将 Spring 会话连接到端口 6379(默认端口)上本地主机上的 Redis 服务器。在生产环境中,你需要更新配置以指向 Redis 服务器。例如,你可以在应用程序中包含以下内容:
+Spring 启动会自动创建一个`RedisConnectionFactory`,它将 Spring Session 连接到端口 6379(默认端口)上本地主机上的 Redis 服务器。在生产环境中,你需要更新配置以指向 Redis 服务器。例如,你可以在应用程序中包含以下内容:
SRC/主/资源/应用程序.properties
@@ -66,13 +66,13 @@ spring.redis.port=6379 # Redis server port.
## [](#boot-servlet-configuration) Servlet 容器初始化
-我们的[Spring Boot Configuration](#boot-spring-configuration)创建了一个名为`springSessionRepositoryFilter`的 Spring Bean,它实现了`Filter`。`springSessionRepositoryFilter` Bean 负责用 Spring 会话支持的自定义实现替换`HttpSession`。
+我们的[Spring Boot Configuration](#boot-spring-configuration)创建了一个名为`springSessionRepositoryFilter`的 Spring Bean,它实现了`Filter`。`springSessionRepositoryFilter` Bean 负责用 Spring Session 支持的自定义实现替换`HttpSession`。
为了使我们的`Filter`发挥其魔力, Spring 需要加载我们的`Config`类。最后,我们需要确保我们的 Servlet 容器(即 Tomcat)为每个请求使用我们的`springSessionRepositoryFilter`。幸运的是,Boot 为我们解决了这两个步骤。
## [](#boot-sample)引导示例应用程序
-引导示例应用程序演示了如何在使用 Spring 引导时使用 Spring 会话透明地利用 Redis 来支持 Web 应用程序的`HttpSession`。
+引导示例应用程序演示了如何在使用 Spring 引导时使用 Spring Session 透明地利用 Redis 来支持 Web 应用程序的`HttpSession`。
### [](#boot-running)运行引导示例应用程序
@@ -99,9 +99,9 @@ $ ./gradlew :spring-session-sample-boot-redis:bootRun
### [](#boot-how)它是如何工作的?
-我们不使用 Tomcat 的`HttpSession`,而是在 Redis 中保存这些值。 Spring 会话用一个由 Redis 支持的实现替换`HttpSession`。当 Spring Security 的`SecurityContextPersistenceFilter`将`SecurityContext`保存到`HttpSession`时,它将被持久化到 Redis 中。
+我们不使用 Tomcat 的`HttpSession`,而是在 Redis 中保存这些值。 Spring Session 用一个由 Redis 支持的实现替换`HttpSession`。当 Spring Security 的`SecurityContextPersistenceFilter`将`SecurityContext`保存到`HttpSession`时,它将被持久化到 Redis 中。
-当创建一个新的`HttpSession`时, Spring 会话将在浏览器中创建一个名为`SESSION`的 cookie。该 cookie 包含你的会话的 ID。你可以查看 cookies(使用[Chrome](https://developers.google.com/web/tools/chrome-devtools/manage-data/cookies)或[Firefox](https://developer.mozilla.org/en-US/docs/Tools/Storage_Inspector))。
+当创建一个新的`HttpSession`时, Spring Session 将在浏览器中创建一个名为`SESSION`的 cookie。该 cookie 包含你的会话的 ID。你可以查看 cookies(使用[Chrome](https://developers.google.com/web/tools/chrome-devtools/manage-data/cookies)或[Firefox](https://developer.mozilla.org/en-US/docs/Tools/Storage_Inspector))。
你可以使用 redis-cli 删除会话。例如,在基于 Linux 的系统上,你可以键入以下内容:
diff --git a/docs/spring-session/boot-webflux-custom-cookie.md b/docs/spring-session/boot-webflux-custom-cookie.md
index ac4a82d5b92ee886286abe581ff72831d5817d21..0f27ffbd560c6ec6e100a569377b8aceb5a9f29d 100644
--- a/docs/spring-session/boot-webflux-custom-cookie.md
+++ b/docs/spring-session/boot-webflux-custom-cookie.md
@@ -1,6 +1,6 @@
# Spring 带有自定义 cookie 的会话-WebFlux
-本指南描述了如何配置 Spring 会话以在基于 WebFlux 的应用程序中使用自定义 Cookie。该指南假定你已经使用所选的数据存储在项目中设置了 Spring 会话。例如,[HttpSession with Redis ](./boot-redis.html)。
+本指南描述了如何配置 Spring Session 以在基于 WebFlux 的应用程序中使用自定义 Cookie。该指南假定你已经使用所选的数据存储在项目中设置了 Spring Session 。例如,[HttpSession with Redis ](./boot-redis.html)。
| |你可以在[WebFlux 自定义 Cookie 示例应用程序](#webflux-custom-cookie-sample)中找到完整的指南。|
|---|------------------------------------------------------------------------------------------------------------------|
@@ -9,7 +9,7 @@
## [](#webflux-custom-cookie-spring-configuration) Spring 引导配置
-一旦设置了 Spring 会话,就可以通过将`WebSessionIdResolver`公开为 Spring Bean 来自定义会话 cookie 的编写方式。 Spring 默认情况下,会话使用`CookieWebSessionIdResolver`。在使用`@EnableRedisHttpSession`之类的配置时,将`WebSessionIdResolver`公开为 Spring Bean 会增强现有的配置。下面的示例展示了如何自定义 Spring 会话的 cookie:
+一旦设置了 Spring Session ,就可以通过将`WebSessionIdResolver`公开为 Spring Bean 来自定义会话 cookie 的编写方式。 Spring 默认情况下,会话使用`CookieWebSessionIdResolver`。在使用`@EnableRedisHttpSession`之类的配置时,将`WebSessionIdResolver`公开为 Spring Bean 会增强现有的配置。下面的示例展示了如何自定义 Spring Session 的 cookie:
```
@Bean
diff --git a/docs/spring-session/boot-websocket.md b/docs/spring-session/boot-websocket.md
index 4ac42beae2d7d44bd5af73fac122a6f0b6fabb61..6374d81cb68d4f935a2288b54e5d486ad368e41a 100644
--- a/docs/spring-session/boot-websocket.md
+++ b/docs/spring-session/boot-websocket.md
@@ -1,6 +1,6 @@
# Spring 会议- WebSocket
-本指南描述了如何使用 Spring 会话来确保 WebSocket 消息使你的 HttpSession 保持活跃。
+本指南描述了如何使用 Spring Session 来确保 WebSocket 消息使你的 HttpSession 保持活跃。
| |Spring session 的 WebSocket 支持仅对 Spring 的 WebSocket 支持有效。 具体来说,它不能直接使用[JSR-356](https://www.jcp.org/en/jsr/detail?id=356),因为 JSR-356 没有拦截传入 WebSocket 消息的机制。|
|---|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
@@ -9,9 +9,9 @@
## [](#_httpsession_setup)HttpSession 设置
-第一步是将 Spring 会话与 HttpSession 集成在一起。这些步骤已经在[HttpSession with Redis 指南](./boot-redis.html)中进行了概述。
+第一步是将 Spring Session 与 HttpSession 集成在一起。这些步骤已经在[HttpSession with Redis 指南](./boot-redis.html)中进行了概述。
-在继续之前,请确保你已经将 Spring 会话集成到 HttpSession 中。
+在继续之前,请确保你已经将 Spring Session 集成到 HttpSession 中。
## [](#websocket-spring-configuration) Spring 配置
@@ -37,7 +37,7 @@ public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
}
```
-我们可以更新配置以使用 Spring 会话的 WebSocket 支持。下面的示例展示了如何做到这一点:
+我们可以更新配置以使用 Spring Session 的 WebSocket 支持。下面的示例展示了如何做到这一点:
SRC/main/java/samples/config/websocketconfig.java
@@ -61,7 +61,7 @@ public class WebSocketConfig extends AbstractSessionWebSocketMessageBrokerConfig
}
```
-要连接 Spring 会话支持,我们只需要更改两件事:
+要连接 Spring Session 支持,我们只需要更改两件事:
|**1**|而不是实现`WebSocketMessageBrokerConfigurer`,我们扩展`AbstractSessionWebSocketMessageBrokerConfigurer`|
|-----|-----------------------------------------------------------------------------------------------------------------------|
@@ -69,17 +69,17 @@ public class WebSocketConfig extends AbstractSessionWebSocketMessageBrokerConfig
`AbstractSessionWebSocketMessageBrokerConfigurer`在幕后做什么?
-* `WebSocketConnectHandlerDecoratorFactory`作为`WebSocketHandlerDecoratorFactory`添加到`WebSocketTransportRegistration`。这确保了一个包含`WebSocketSession`的自定义`SessionConnectEvent`被触发。当 Spring 会话结束时,要结束任何仍处于打开状态的 WebSocket 连接,`WebSocketSession`是必需的。
+* `WebSocketConnectHandlerDecoratorFactory`作为`WebSocketHandlerDecoratorFactory`添加到`WebSocketTransportRegistration`。这确保了一个包含`WebSocketSession`的自定义`SessionConnectEvent`被触发。当 Spring Session 结束时,要结束任何仍处于打开状态的 WebSocket 连接,`WebSocketSession`是必需的。
* `SessionRepositoryMessageInterceptor`作为`HandshakeInterceptor`添加到每个`StompWebSocketEndpointRegistration`。这确保将`Session`添加到 WebSocket 属性中,以允许更新上次访问的时间。
-* `SessionRepositoryMessageInterceptor`作为`ChannelInterceptor`添加到我们的入站`ChannelRegistration`中。这确保了每次接收入站消息时,都会更新我们 Spring 会话的最后一次访问时间。
+* `SessionRepositoryMessageInterceptor`作为`ChannelInterceptor`添加到我们的入站`ChannelRegistration`中。这确保了每次接收入站消息时,都会更新我们 Spring Session 的最后一次访问时间。
-* `WebSocketRegistryListener`被创建为 Spring Bean。这确保了我们将所有`Session`ID 映射到相应的 WebSocket 连接。通过维护此映射,我们可以在 Spring 会话结束时关闭所有 WebSocket 连接。
+* `WebSocketRegistryListener`被创建为 Spring Bean。这确保了我们将所有`Session`ID 映射到相应的 WebSocket 连接。通过维护此映射,我们可以在 Spring Session 结束时关闭所有 WebSocket 连接。
## [](#websocket-sample)`websocket`示例应用程序
-`websocket`示例应用程序演示了如何在 WebSockets 中使用 Spring 会话。
+`websocket`示例应用程序演示了如何在 WebSockets 中使用 Spring Session 。
### [](#_running_the_websocket_sample_application)运行`websocket`示例应用程序
@@ -119,7 +119,7 @@ $ ./gradlew :spring-session-sample-boot-websocket:bootRun
等两分钟,再试着把罗布的信息发送给卢克。你可以看到该消息已不再发送。
-| |为什么是两分钟? Spring 会话在 60 秒内到期,但是来自 Redis 的通知不能保证在 60 秒内发生。 以确保套接字在合理的时间内关闭, Spring 会话在 00 秒时每分钟运行一个后台任务,该任务强制清除任何过期的会话。 这意味着在关闭 WebSocket 连接之前,你最多需要等待两分钟。|
+| |为什么是两分钟? Spring Session 在 60 秒内到期,但是来自 Redis 的通知不能保证在 60 秒内发生。 以确保套接字在合理的时间内关闭, Spring Session 在 00 秒时每分钟运行一个后台任务,该任务强制清除任何过期的会话。 这意味着在关闭 WebSocket 连接之前,你最多需要等待两分钟。|
|---|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
你现在可以尝试访问[http://localhost:8080/](http://localhost:8080/),提示你再次进行身份验证。这表明会话正确地过期了。
diff --git a/docs/spring-session/en/api.md b/docs/spring-session/en/api.md
deleted file mode 100644
index 03743369bac1ec5bce75937b71e2e1d6787836ad..0000000000000000000000000000000000000000
--- a/docs/spring-session/en/api.md
+++ /dev/null
@@ -1,740 +0,0 @@
-# API Documentation
-
-## [](#api-session)Using `Session`
-
-A `Session` is a simplified `Map` of name value pairs.
-
-Typical usage might look like the following listing:
-
-```
-public class RepositoryDemo {
-
- private SessionRepository repository; (1)
-
- public void demo() {
- S toSave = this.repository.createSession(); (2)
-
- (3)
- User rwinch = new User("rwinch");
- toSave.setAttribute(ATTR_USER, rwinch);
-
- this.repository.save(toSave); (4)
-
- S session = this.repository.findById(toSave.getId()); (5)
-
- (6)
- User user = session.getAttribute(ATTR_USER);
- assertThat(user).isEqualTo(rwinch);
- }
-
- // ... setter methods ...
-
-}
-```
-
-|**1**| We create a `SessionRepository` instance with a generic type, `S`, that extends `Session`. The generic type is defined in our class. |
-|-----|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-|**2**| We create a new `Session` by using our `SessionRepository` and assign it to a variable of type `S`. |
-|**3**| We interact with the `Session`. In our example, we demonstrate saving a `User` to the `Session`. |
-|**4**|We now save the `Session`. This is why we needed the generic type `S`. The `SessionRepository` only allows saving `Session` instances that were created or retrieved by using the same `SessionRepository`. This allows for the `SessionRepository` to make implementation specific optimizations (that is, writing only attributes that have changed).|
-|**5**| We retrieve the `Session` from the `SessionRepository`. |
-|**6**| We obtain the persisted `User` from our `Session` without the need for explicitly casting our attribute. |
-
-The `Session` API also provides attributes related to the `Session` instance’s expiration.
-
-Typical usage might look like the following listing:
-
-```
-public class ExpiringRepositoryDemo {
-
- private SessionRepository repository; (1)
-
- public void demo() {
- S toSave = this.repository.createSession(); (2)
- // ...
- toSave.setMaxInactiveInterval(Duration.ofSeconds(30)); (3)
-
- this.repository.save(toSave); (4)
-
- S session = this.repository.findById(toSave.getId()); (5)
- // ...
- }
-
- // ... setter methods ...
-
-}
-```
-
-|**1**| We create a `SessionRepository` instance with a generic type, `S`, that extends `Session`. The generic type is defined in our class. |
-|-----|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-|**2**| We create a new `Session` by using our `SessionRepository` and assign it to a variable of type `S`. |
-|**3**| We interact with the `Session`. In our example, we demonstrate updating the amount of time the `Session` can be inactive before it expires. |
-|**4**|We now save the `Session`. This is why we needed the generic type, `S`. The `SessionRepository` allows saving only `Session` instances that were created or retrieved using the same `SessionRepository`. This allows for the `SessionRepository` to make implementation specific optimizations (that is, writing only attributes that have changed). The last accessed time is automatically updated when the `Session` is saved.|
-|**5**| We retrieve the `Session` from the `SessionRepository`. If the `Session` were expired, the result would be null. |
-
-## [](#api-sessionrepository)Using `SessionRepository`
-
-A `SessionRepository` is in charge of creating, retrieving, and persisting `Session` instances.
-
-If possible, you should not interact directly with a `SessionRepository` or a `Session`.
-Instead, developers should prefer interacting with `SessionRepository` and `Session` indirectly through the [`HttpSession`](http-session.html#httpsession) and [WebSocket](web-socket.html#websocket) integration.
-
-## [](#api-findbyindexnamesessionrepository)Using `FindByIndexNameSessionRepository`
-
-Spring Session’s most basic API for using a `Session` is the `SessionRepository`.
-This API is intentionally very simple, so that you can easily provide additional implementations with basic functionality.
-
-Some `SessionRepository` implementations may also choose to implement `FindByIndexNameSessionRepository`.
-For example, Spring’s Redis, JDBC, and Hazelcast support libraries all implement `FindByIndexNameSessionRepository`.
-
-The `FindByIndexNameSessionRepository` provides a method to look up all the sessions with a given index name and index value.
-As a common use case that is supported by all provided `FindByIndexNameSessionRepository` implementations, you can use a convenient method to look up all the sessions for a particular user.
-This is done by ensuring that the session attribute with the name of `FindByIndexNameSessionRepository.PRINCIPAL_NAME_INDEX_NAME` is populated with the username.
-It is your responsibility to ensure that the attribute is populated, since Spring Session is not aware of the authentication mechanism being used.
-An example of how to use this can be seen in the following listing:
-
-```
-String username = "username";
-this.session.setAttribute(FindByIndexNameSessionRepository.PRINCIPAL_NAME_INDEX_NAME, username);
-```
-
-| |Some implementations of `FindByIndexNameSessionRepository` provide hooks to automatically index other session attributes. For example, many implementations automatically ensure that the current Spring Security user name is indexed with the index name of `FindByIndexNameSessionRepository.PRINCIPAL_NAME_INDEX_NAME`.|
-|---|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-
-Once the session is indexed, you can find by using code similar to the following:
-
-```
-String username = "username";
-Map sessionIdToSession = this.sessionRepository.findByPrincipalName(username);
-```
-
-## [](#api-reactivesessionrepository)Using `ReactiveSessionRepository`
-
-A `ReactiveSessionRepository` is in charge of creating, retrieving, and persisting `Session` instances in a non-blocking and reactive manner.
-
-If possible, you should not interact directly with a `ReactiveSessionRepository` or a `Session`.
-Instead, you should prefer interacting with `ReactiveSessionRepository` and `Session` indirectly through the [WebSession](web-session.html#websession) integration.
-
-## [](#api-enablespringhttpsession)Using `@EnableSpringHttpSession`
-
-You can add the `@EnableSpringHttpSession` annotation to a `@Configuration` class to expose the `SessionRepositoryFilter` as a bean named `springSessionRepositoryFilter`.
-In order to use the annotation, you must provide a single `SessionRepository` bean.
-The following example shows how to do so:
-
-```
-@EnableSpringHttpSession
-@Configuration
-public class SpringHttpSessionConfig {
-
- @Bean
- public MapSessionRepository sessionRepository() {
- return new MapSessionRepository(new ConcurrentHashMap<>());
- }
-
-}
-```
-
-Note that no infrastructure for session expirations is configured for you.
-This is because things such as session expiration are highly implementation-dependent.
-This means that, if you need to clean up expired sessions, you are responsible for cleaning up the expired sessions.
-
-## [](#api-enablespringwebsession)Using `@EnableSpringWebSession`
-
-You can add the `@EnableSpringWebSession` annotation to a `@Configuration` class to expose the `WebSessionManager` as a bean named `webSessionManager`.
-To use the annotation, you must provide a single `ReactiveSessionRepository` bean.
-The following example shows how to do so:
-
-```
-@EnableSpringWebSession
-public class SpringWebSessionConfig {
-
- @Bean
- public ReactiveSessionRepository reactiveSessionRepository() {
- return new ReactiveMapSessionRepository(new ConcurrentHashMap<>());
- }
-
-}
-```
-
-Note that no infrastructure for session expirations is configured for you.
-This is because things such as session expiration are highly implementation-dependent.
-This means that, if you require cleaning up expired sessions, you are responsible for cleaning up the expired sessions.
-
-## [](#api-redisindexedsessionrepository)Using `RedisIndexedSessionRepository`
-
-`RedisIndexedSessionRepository` is a `SessionRepository` that is implemented by using Spring Data’s `RedisOperations`.
-In a web environment, this is typically used in combination with `SessionRepositoryFilter`.
-The implementation supports `SessionDestroyedEvent` and `SessionCreatedEvent` through `SessionMessageListener`.
-
-### [](#api-redisindexedsessionrepository-new)Instantiating a `RedisIndexedSessionRepository`
-
-You can see a typical example of how to create a new instance in the following listing:
-
-```
-RedisTemplate redisTemplate = new RedisTemplate<>();
-
-// ... configure redisTemplate ...
-
-SessionRepository extends Session> repository = new RedisIndexedSessionRepository(redisTemplate);
-```
-
-For additional information on how to create a `RedisConnectionFactory`, see the Spring Data Redis Reference.
-
-### [](#api-redisindexedsessionrepository-config)Using `@EnableRedisHttpSession`
-
-In a web environment, the simplest way to create a new `RedisIndexedSessionRepository` is to use `@EnableRedisHttpSession`.
-You can find complete example usage in the [Samples and Guides (Start Here)](samples.html#samples).
-You can use the following attributes to customize the configuration:
-
-* **maxInactiveIntervalInSeconds**: The amount of time before the session expires, in seconds.
-
-* **redisNamespace**: Allows configuring an application specific namespace for the sessions. Redis keys and channel IDs start with the prefix of `:`.
-
-* **flushMode**: Allows specifying when data is written to Redis. The default is only when `save` is invoked on `SessionRepository`.
- A value of `FlushMode.IMMEDIATE` writes to Redis as soon as possible.
-
-#### [](#_custom_redisserializer)Custom `RedisSerializer`
-
-You can customize the serialization by creating a bean named `springSessionDefaultRedisSerializer` that implements `RedisSerializer`.
-
-### [](#_redis_taskexecutor)Redis `TaskExecutor`
-
-`RedisIndexedSessionRepository` is subscribed to receive events from Redis by using a `RedisMessageListenerContainer`.
-You can customize the way those events are dispatched by creating a bean named `springSessionRedisTaskExecutor`, a bean `springSessionRedisSubscriptionExecutor`, or both.
-You can find more details on configuring Redis task executors [here](https://docs.spring.io/spring-data-redis/docs/2.6.2/reference/html/#redis:pubsub:subscribe:containers).
-
-### [](#api-redisindexedsessionrepository-storage)Storage Details
-
-The following sections outline how Redis is updated for each operation.
-The following example shows an example of creating a new session:
-
-```
-HMSET spring:session:sessions:33fdd1b6-b496-4b33-9f7d-df96679d32fe creationTime 1404360000000 \
- maxInactiveInterval 1800 \
- lastAccessedTime 1404360000000 \
- sessionAttr:attrName someAttrValue \
- sessionAttr:attrName2 someAttrValue2
-EXPIRE spring:session:sessions:33fdd1b6-b496-4b33-9f7d-df96679d32fe 2100
-APPEND spring:session:sessions:expires:33fdd1b6-b496-4b33-9f7d-df96679d32fe ""
-EXPIRE spring:session:sessions:expires:33fdd1b6-b496-4b33-9f7d-df96679d32fe 1800
-SADD spring:session:expirations:1439245080000 expires:33fdd1b6-b496-4b33-9f7d-df96679d32fe
-EXPIRE spring:session:expirations1439245080000 2100
-```
-
-The subsequent sections describe the details.
-
-#### [](#_saving_a_session)Saving a Session
-
-Each session is stored in Redis as a `Hash`.
-Each session is set and updated by using the `HMSET` command.
-The following example shows how each session is stored:
-
-```
-HMSET spring:session:sessions:33fdd1b6-b496-4b33-9f7d-df96679d32fe creationTime 1404360000000 \
- maxInactiveInterval 1800 \
- lastAccessedTime 1404360000000 \
- sessionAttr:attrName someAttrValue \
- sessionAttr:attrName2 someAttrValue2
-```
-
-In the preceding example, the following statements are true about the session:
-
-* The session ID is 33fdd1b6-b496-4b33-9f7d-df96679d32fe.
-
-* The session was created at 1404360000000 (in milliseconds since midnight of 1/1/1970 GMT).
-
-* The session expires in 1800 seconds (30 minutes).
-
-* The session was last accessed at 1404360000000 (in milliseconds since midnight of 1/1/1970 GMT).
-
-* The session has two attributes.
- The first is `attrName`, with a value of `someAttrValue`.
- The second session attribute is named `attrName2`, with a value of `someAttrValue2`.
-
-#### [](#api-redisindexedsessionrepository-writes)Optimized Writes
-
-The `Session` instances managed by `RedisIndexedSessionRepository` keeps track of the properties that have changed and updates only those.
-This means that, if an attribute is written once and read many times, we need to write that attribute only once.
-For example, assume the `attrName2` session attribute from the lsiting in the preceding section was updated.
-The following command would be run upon saving:
-
-```
-HMSET spring:session:sessions:33fdd1b6-b496-4b33-9f7d-df96679d32fe sessionAttr:attrName2 newValue
-```
-
-#### [](#api-redisindexedsessionrepository-expiration)Session Expiration
-
-An expiration is associated with each session by using the `EXPIRE` command, based upon the `Session.getMaxInactiveInterval()`.
-The following example shows a typical `EXPIRE` command:
-
-```
-EXPIRE spring:session:sessions:33fdd1b6-b496-4b33-9f7d-df96679d32fe 2100
-```
-
-Note that the expiration that is set to five minutes after the session actually expires.
-This is necessary so that the value of the session can be accessed when the session expires.
-An expiration is set on the session itself five minutes after it actually expires to ensure that it is cleaned up, but only after we perform any necessary processing.
-
-| |The `SessionRepository.findById(String)` method ensures that no expired sessions are returned. This means that you need not check the expiration before using a session.|
-|---|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-
-Spring Session relies on the delete and expired [keyspace notifications](https://redis.io/topics/notifications) from Redis to fire a [`SessionDeletedEvent`](#api-redisindexedsessionrepository-sessiondestroyedevent) and a [`SessionExpiredEvent`](#api-redisindexedsessionrepository-sessiondestroyedevent), respectively.`SessionDeletedEvent` or `SessionExpiredEvent` ensure that resources associated with the `Session` are cleaned up.
-For example, when you use Spring Session’s WebSocket support, the Redis expired or delete event triggers any WebSocket connections associated with the session to be closed.
-
-Expiration is not tracked directly on the session key itself, since this would mean the session data would no longer be available. Instead, a special session expires key is used. In the preceding example, the expires key is as follows:
-
-```
-APPEND spring:session:sessions:expires:33fdd1b6-b496-4b33-9f7d-df96679d32fe ""
-EXPIRE spring:session:sessions:expires:33fdd1b6-b496-4b33-9f7d-df96679d32fe 1800
-```
-
-When a session expires key is deleted or expires, the keyspace notification triggers a lookup of the actual session, and a `SessionDestroyedEvent` is fired.
-
-One problem with relying on Redis expiration exclusively is that, if the key has not been accessed, Redis makes no guarantee of when the expired event is fired.
-Specifically, the background task that Redis uses to clean up expired keys is a low-priority task and may not trigger the key expiration.
-For additional details, see the [Timing of Expired Events](https://redis.io/topics/notifications) section in the Redis documentation.
-
-To circumvent the fact that expired events are not guaranteed to happen, we can ensure that each key is accessed when it is expected to expire.
-This means that, if the TTL is expired on the key, Redis removes the key and fires the expired event when we try to access the key.
-
-For this reason, each session expiration is also tracked to the nearest minute.
-This lets a background task access the potentially expired sessions to ensure that Redis expired events are fired in a more deterministic fashion.
-The following example shows these events:
-
-```
-SADD spring:session:expirations:1439245080000 expires:33fdd1b6-b496-4b33-9f7d-df96679d32fe
-EXPIRE spring:session:expirations1439245080000 2100
-```
-
-The background task then uses these mappings to explicitly request each key.
-By accessing the key, rather than deleting it, we ensure that Redis deletes the key for us only if the TTL is expired.
-
-| |We do not explicitly delete the keys, since, in some instances, there may be a race condition that incorrectly identifies a key as expired when it is not. Short of using distributed locks (which would kill our performance), there is no way to ensure the consistency of the expiration mapping. By simply accessing the key, we ensure that the key is only removed if the TTL on that key is expired.|
-|---|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-
-### [](#api-redisindexedsessionrepository-sessiondestroyedevent)`SessionDeletedEvent` and `SessionExpiredEvent`
-
-`SessionDeletedEvent` and `SessionExpiredEvent` are both types of `SessionDestroyedEvent`.
-
-`RedisIndexedSessionRepository` supports firing a `SessionDeletedEvent` when a `Session` is deleted or a `SessionExpiredEvent` when a `Session` expires.
-This is necessary to ensure resources associated with the `Session` are properly cleaned up.
-
-For example, when integrating with WebSockets, the `SessionDestroyedEvent` is in charge of closing any active WebSocket connections.
-
-Firing `SessionDeletedEvent` or `SessionExpiredEvent` is made available through the `SessionMessageListener`, which listens to [Redis Keyspace events](https://redis.io/topics/notifications).
-In order for this to work, Redis Keyspace events for Generic commands and Expired events needs to be enabled.
-The following example shows how to do so:
-
-```
-redis-cli config set notify-keyspace-events Egx
-```
-
-If you use `@EnableRedisHttpSession`, managing the `SessionMessageListener` and enabling the necessary Redis Keyspace events is done automatically.
-However, in a secured Redis enviornment, the config command is disabled.
-This means that Spring Session cannot configure Redis Keyspace events for you.
-To disable the automatic configuration, add `ConfigureRedisAction.NO_OP` as a bean.
-
-For example, with Java configuration, you can use the following:
-
-```
-@Bean
-ConfigureRedisAction configureRedisAction() {
- return ConfigureRedisAction.NO_OP;
-}
-```
-
-In XML configuration, you can use the following:
-
-```
-
-```
-
-### [](#api-redisindexedsessionrepository-sessioncreatedevent)Using `SessionCreatedEvent`
-
-When a session is created, an event is sent to Redis with a channel ID of `spring:session:channel:created:33fdd1b6-b496-4b33-9f7d-df96679d32fe`,
-where `33fdd1b6-b496-4b33-9f7d-df96679d32fe` is the session ID. The body of the event is the session that was created.
-
-If registered as a `MessageListener` (the default), `RedisIndexedSessionRepository` then translates the Redis message into a `SessionCreatedEvent`.
-
-### [](#api-redisindexedsessionrepository-cli)Viewing the Session in Redis
-
-After [installing redis-cli](https://redis.io/topics/quickstart), you can inspect the values in Redis [using the redis-cli](https://redis.io/commands#hash).
-For example, you can enter the following into a terminal:
-
-```
-$ redis-cli
-redis 127.0.0.1:6379> keys *
-1) "spring:session:sessions:4fc39ce3-63b3-4e17-b1c4-5e1ed96fb021" (1)
-2) "spring:session:expirations:1418772300000" (2)
-```
-
-|**1**| The suffix of this key is the session identifier of the Spring Session. |
-|-----|-----------------------------------------------------------------------------------------|
-|**2**|This key contains all the session IDs that should be deleted at the time `1418772300000`.|
-
-You can also view the attributes of each session.
-The following example shows how to do so:
-
-```
-redis 127.0.0.1:6379> hkeys spring:session:sessions:4fc39ce3-63b3-4e17-b1c4-5e1ed96fb021
-1) "lastAccessedTime"
-2) "creationTime"
-3) "maxInactiveInterval"
-4) "sessionAttr:username"
-redis 127.0.0.1:6379> hget spring:session:sessions:4fc39ce3-63b3-4e17-b1c4-5e1ed96fb021 sessionAttr:username
-"\xac\xed\x00\x05t\x00\x03rob"
-```
-
-## [](#api-reactiveredissessionrepository)Using `ReactiveRedisSessionRepository`
-
-`ReactiveRedisSessionRepository` is a `ReactiveSessionRepository` that is implemented by using Spring Data’s `ReactiveRedisOperations`.
-In a web environment, this is typically used in combination with `WebSessionStore`.
-
-### [](#api-reactiveredissessionrepository-new)Instantiating a `ReactiveRedisSessionRepository`
-
-The following example shows how to create a new instance:
-
-```
-// ... create and configure connectionFactory and serializationContext ...
-
-ReactiveRedisTemplate redisTemplate = new ReactiveRedisTemplate<>(connectionFactory,
- serializationContext);
-
-ReactiveSessionRepository extends Session> repository = new ReactiveRedisSessionRepository(redisTemplate);
-```
-
-For additional information on how to create a `ReactiveRedisConnectionFactory`, see the Spring Data Redis Reference.
-
-### [](#api-reactiveredissessionrepository-config)Using `@EnableRedisWebSession`
-
-In a web environment, the simplest way to create a new `ReactiveRedisSessionRepository` is to use `@EnableRedisWebSession`.
-You can use the following attributes to customize the configuration:
-
-* **maxInactiveIntervalInSeconds**: The amount of time before the session expires, in seconds
-
-* **redisNamespace**: Allows configuring an application specific namespace for the sessions. Redis keys and channel IDs start with q prefix of `:`.
-
-* **flushMode**: Allows specifying when data is written to Redis. The default is only when `save` is invoked on `ReactiveSessionRepository`.
- A value of `FlushMode.IMMEDIATE` writes to Redis as soon as possible.
-
-#### [](#api-reactiveredissessionrepository-writes)Optimized Writes
-
-The `Session` instances managed by `ReactiveRedisSessionRepository` keep track of the properties that have changed and updates only those.
-This means that, if an attribute is written once and read many times, we need to write that attribute only once.
-
-### [](#api-reactiveredissessionrepository-cli)Viewing the Session in Redis
-
-After [installing redis-cli](https://redis.io/topics/quickstart), you can inspect the values in Redis [using the redis-cli](https://redis.io/commands#hash).
-For example, you can enter the following command into a terminal window:
-
-```
-$ redis-cli
-redis 127.0.0.1:6379> keys *
-1) "spring:session:sessions:4fc39ce3-63b3-4e17-b1c4-5e1ed96fb021" (1)
-```
-
-|**1**|The suffix of this key is the session identifier of the Spring Session.|
-|-----|-----------------------------------------------------------------------|
-
-You can also view the attributes of each session by using the `hkeys` command.
-The following example shows how to do so:
-
-```
-redis 127.0.0.1:6379> hkeys spring:session:sessions:4fc39ce3-63b3-4e17-b1c4-5e1ed96fb021
-1) "lastAccessedTime"
-2) "creationTime"
-3) "maxInactiveInterval"
-4) "sessionAttr:username"
-redis 127.0.0.1:6379> hget spring:session:sessions:4fc39ce3-63b3-4e17-b1c4-5e1ed96fb021 sessionAttr:username
-"\xac\xed\x00\x05t\x00\x03rob"
-```
-
-## [](#api-mapsessionrepository)Using `MapSessionRepository`
-
-The `MapSessionRepository` allows for persisting `Session` in a `Map`, with the key being the `Session` ID and the value being the `Session`.
-You can use the implementation with a `ConcurrentHashMap` as a testing or convenience mechanism.
-Alternatively, you can use it with distributed `Map` implementations. For example, it can be used with Hazelcast.
-
-### [](#api-mapsessionrepository-new)Instantiating `MapSessionRepository`
-
-The following example shows how to create a new instance:
-
-```
-SessionRepository extends Session> repository = new MapSessionRepository(new ConcurrentHashMap<>());
-```
-
-### [](#api-mapsessionrepository-hazelcast)Using Spring Session and Hazlecast
-
-The [Hazelcast Sample](samples.html#samples) is a complete application that demonstrates how to use Spring Session with Hazelcast.
-
-To run it, use the following command:
-
-```
- ./gradlew :samples:hazelcast:tomcatRun
-```
-
-The [Hazelcast Spring Sample](samples.html#samples) is a complete application that demonstrates how to use Spring Session with Hazelcast and Spring Security.
-
-It includes example Hazelcast `MapListener` implementations that support firing `SessionCreatedEvent`, `SessionDeletedEvent`, and `SessionExpiredEvent`.
-
-To run it, use the following command:
-
-```
- ./gradlew :samples:hazelcast-spring:tomcatRun
-```
-
-## [](#api-reactivemapsessionrepository)Using `ReactiveMapSessionRepository`
-
-The `ReactiveMapSessionRepository` allows for persisting `Session` in a `Map`, with the key being the `Session` ID and the value being the `Session`.
-You can use the implementation with a `ConcurrentHashMap` as a testing or convenience mechanism.
-Alternatively, you can use it with distributed `Map` implementations, with the requirement that the supplied `Map` must be non-blocking.
-
-## [](#api-jdbcindexedsessionrepository)Using `JdbcIndexedSessionRepository`
-
-`JdbcIndexedSessionRepository` is a `SessionRepository` implementation that uses Spring’s `JdbcOperations` to store sessions in a relational database.
-In a web environment, this is typically used in combination with `SessionRepositoryFilter`.
-Note that this implementation does not support publishing of session events.
-
-### [](#api-jdbcindexedsessionrepository-new)Instantiating a `JdbcIndexedSessionRepository`
-
-The following example shows how to create a new instance:
-
-```
-JdbcTemplate jdbcTemplate = new JdbcTemplate();
-
-// ... configure jdbcTemplate ...
-
-TransactionTemplate transactionTemplate = new TransactionTemplate();
-
-// ... configure transactionTemplate ...
-
-SessionRepository extends Session> repository = new JdbcIndexedSessionRepository(jdbcTemplate,
- transactionTemplate);
-```
-
-For additional information on how to create and configure `JdbcTemplate` and `PlatformTransactionManager`, see the [Spring Framework Reference Documentation](https://docs.spring.io/spring/docs/5.3.16/spring-framework-reference/data-access.html).
-
-### [](#api-jdbcindexedsessionrepository-config)Using `@EnableJdbcHttpSession`
-
-In a web environment, the simplest way to create a new `JdbcIndexedSessionRepository` is to use `@EnableJdbcHttpSession`.
-You can find complete example usage in the [Samples and Guides (Start Here)](samples.html#samples)You can use the following attributes to customize the configuration:
-
-* **tableName**: The name of database table used by Spring Session to store sessions
-
-* **maxInactiveIntervalInSeconds**: The amount of time before the session will expire in seconds
-
-#### [](#_customizing_lobhandler)Customizing `LobHandler`
-
-You can customize BLOB handling by creating a bean named `springSessionLobHandler` that implements `LobHandler`.
-
-#### [](#_customizing_conversionservice)Customizing `ConversionService`
-
-You can customize the default serialization and deserialization of the session by providing a `ConversionService` instance.
-When working in a typical Spring environment, the default `ConversionService` bean (named `conversionService`) is automatically picked up and used for serialization and deserialization.
-However, you can override the default `ConversionService` by providing a bean named `springSessionConversionService`.
-
-### [](#api-jdbcindexedsessionrepository-storage)Storage Details
-
-By default, this implementation uses `SPRING_SESSION` and `SPRING_SESSION_ATTRIBUTES` tables to store sessions.
-Note that you can customize the table name, as already described. In that case, the table used to store attributes is named by using the provided table name suffixed with `_ATTRIBUTES`.
-If further customizations are needed, you can customize the SQL queries used by the repository by using `set*Query` setter methods. In this case, you need to manually configure the `sessionRepository` bean.
-
-Due to the differences between the various database vendors, especially when it comes to storing binary data, make sure to use SQL scripts specific to your database.
-Scripts for most major database vendors are packaged as `org/springframework/session/jdbc/schema-*.sql`, where `*` is the target database type.
-
-For example, with PostgreSQL, you can use the following schema script:
-
-```
-CREATE TABLE SPRING_SESSION (
- PRIMARY_ID CHAR(36) NOT NULL,
- SESSION_ID CHAR(36) NOT NULL,
- CREATION_TIME BIGINT NOT NULL,
- LAST_ACCESS_TIME BIGINT NOT NULL,
- MAX_INACTIVE_INTERVAL INT NOT NULL,
- EXPIRY_TIME BIGINT NOT NULL,
- PRINCIPAL_NAME VARCHAR(100),
- CONSTRAINT SPRING_SESSION_PK PRIMARY KEY (PRIMARY_ID)
-);
-
-CREATE UNIQUE INDEX SPRING_SESSION_IX1 ON SPRING_SESSION (SESSION_ID);
-CREATE INDEX SPRING_SESSION_IX2 ON SPRING_SESSION (EXPIRY_TIME);
-CREATE INDEX SPRING_SESSION_IX3 ON SPRING_SESSION (PRINCIPAL_NAME);
-
-CREATE TABLE SPRING_SESSION_ATTRIBUTES (
- SESSION_PRIMARY_ID CHAR(36) NOT NULL,
- ATTRIBUTE_NAME VARCHAR(200) NOT NULL,
- ATTRIBUTE_BYTES BYTEA NOT NULL,
- CONSTRAINT SPRING_SESSION_ATTRIBUTES_PK PRIMARY KEY (SESSION_PRIMARY_ID, ATTRIBUTE_NAME),
- CONSTRAINT SPRING_SESSION_ATTRIBUTES_FK FOREIGN KEY (SESSION_PRIMARY_ID) REFERENCES SPRING_SESSION(PRIMARY_ID) ON DELETE CASCADE
-);
-```
-
-With MySQL database, you can use the following script:
-
-```
-CREATE TABLE SPRING_SESSION (
- PRIMARY_ID CHAR(36) NOT NULL,
- SESSION_ID CHAR(36) NOT NULL,
- CREATION_TIME BIGINT NOT NULL,
- LAST_ACCESS_TIME BIGINT NOT NULL,
- MAX_INACTIVE_INTERVAL INT NOT NULL,
- EXPIRY_TIME BIGINT NOT NULL,
- PRINCIPAL_NAME VARCHAR(100),
- CONSTRAINT SPRING_SESSION_PK PRIMARY KEY (PRIMARY_ID)
-) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
-
-CREATE UNIQUE INDEX SPRING_SESSION_IX1 ON SPRING_SESSION (SESSION_ID);
-CREATE INDEX SPRING_SESSION_IX2 ON SPRING_SESSION (EXPIRY_TIME);
-CREATE INDEX SPRING_SESSION_IX3 ON SPRING_SESSION (PRINCIPAL_NAME);
-
-CREATE TABLE SPRING_SESSION_ATTRIBUTES (
- SESSION_PRIMARY_ID CHAR(36) NOT NULL,
- ATTRIBUTE_NAME VARCHAR(200) NOT NULL,
- ATTRIBUTE_BYTES BLOB NOT NULL,
- CONSTRAINT SPRING_SESSION_ATTRIBUTES_PK PRIMARY KEY (SESSION_PRIMARY_ID, ATTRIBUTE_NAME),
- CONSTRAINT SPRING_SESSION_ATTRIBUTES_FK FOREIGN KEY (SESSION_PRIMARY_ID) REFERENCES SPRING_SESSION(PRIMARY_ID) ON DELETE CASCADE
-) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
-```
-
-### [](#_transaction_management)Transaction Management
-
-All JDBC operations in `JdbcIndexedSessionRepository` are performed in a transactional manner.
-Transactions are performed with propagation set to `REQUIRES_NEW` in order to avoid unexpected behavior due to interference with existing transactions (for example, running a `save` operation in a thread that already participates in a read-only transaction).
-
-## [](#api-hazelcastindexedsessionrepository)Using `HazelcastIndexedSessionRepository`
-
-`HazelcastIndexedSessionRepository` is a `SessionRepository` implementation that stores sessions in Hazelcast’s distributed `IMap`.
-In a web environment, this is typically used in combination with `SessionRepositoryFilter`.
-
-### [](#api-hazelcastindexedsessionrepository-new)Instantiating a `HazelcastIndexedSessionRepository`
-
-The following example shows how to create a new instance:
-
-```
-Config config = new Config();
-
-// ... configure Hazelcast ...
-
-HazelcastInstance hazelcastInstance = Hazelcast.newHazelcastInstance(config);
-
-HazelcastIndexedSessionRepository repository = new HazelcastIndexedSessionRepository(hazelcastInstance);
-```
-
-For additional information on how to create and configure Hazelcast instance, see the [Hazelcast documentation](https://docs.hazelcast.org/docs/3.12.12/manual/html-single/index.html#hazelcast-configuration).
-
-### [](#api-enablehazelcasthttpsession)Using `@EnableHazelcastHttpSession`
-
-To use [Hazelcast](https://hazelcast.org/) as your backing source for the `SessionRepository`, you can add the `@EnableHazelcastHttpSession` annotation to a `@Configuration` class.
-Doing so extends the functionality provided by the `@EnableSpringHttpSession` annotation but makes the `SessionRepository` for you in Hazelcast.
-You must provide a single `HazelcastInstance` bean for the configuration to work.
-You can find a complete configuration example in the [Samples and Guides (Start Here)](samples.html#samples).
-
-### [](#api-enablehazelcasthttpsession-customize)Basic Customization
-
-You can use the following attributes on `@EnableHazelcastHttpSession` to customize the configuration:
-
-* **maxInactiveIntervalInSeconds**: The amount of time before the session expires, in seconds. The default is 1800 seconds (30 minutes)
-
-* **sessionMapName**: The name of the distributed `Map` that is used in Hazelcast to store the session data.
-
-### [](#api-enablehazelcasthttpsession-events)Session Events
-
-Using a `MapListener` to respond to entries being added, evicted, and removed from the distributed `Map` causes these events to trigger publishing of `SessionCreatedEvent`, `SessionExpiredEvent`, and `SessionDeletedEvent` events (respectively) through the `ApplicationEventPublisher`.
-
-### [](#api-enablehazelcasthttpsession-storage)Storage Details
-
-Sessions are stored in a distributed `IMap` in Hazelcast.
-The `IMap` interface methods are used to `get()` and `put()` Sessions.
-Additionally, the `values()` method supports a `FindByIndexNameSessionRepository#findByIndexNameAndIndexValue` operation, together with appropriate `ValueExtractor` (which needs to be registered with Hazelcast). See the [ Hazelcast Spring Sample](samples.html#samples) for more details on this configuration.
-The expiration of a session in the `IMap` is handled by Hazelcast’s support for setting the time to live on an entry when it is `put()` into the `IMap`. Entries (sessions) that have been idle longer than the time to live are automatically removed from the `IMap`.
-
-You should not need to configure any settings such as `max-idle-seconds` or `time-to-live-seconds` for the `IMap` within the Hazelcast configuration.
-
-Note that if you use Hazelcast’s `MapStore` to persist your sessions `IMap`, the following limitations apply when reloading the sessions from `MapStore`:
-
-* Reloading triggers `EntryAddedListener` results in `SessionCreatedEvent` being re-published
-
-* Reloading uses default TTL for a given `IMap` results in sessions losing their original TTL
-
-## [](#api-cookieserializer)Using `CookieSerializer`
-
-A `CookieSerializer` is responsible for defining how the session cookie is written.
-Spring Session comes with a default implementation using `DefaultCookieSerializer`.
-
-### [](#api-cookieserializer-bean)Exposing `CookieSerializer` as a bean
-
-Exposing the `CookieSerializer` as a Spring bean augments the existing configuration when you use configurations like `@EnableRedisHttpSession`.
-
-The following example shows how to do so:
-
-```
- @Bean
- public CookieSerializer cookieSerializer() {
- DefaultCookieSerializer serializer = new DefaultCookieSerializer();
- serializer.setCookieName("JSESSIONID"); (1)
- serializer.setCookiePath("/"); (2)
- serializer.setDomainNamePattern("^.+?\\.(\\w+\\.[a-z]+)$"); (3)
- return serializer;
- }
-```
-
-|**1**| We customize the name of the cookie to be `JSESSIONID`. |
-|-----|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-|**2**| We customize the path of the cookie to be `/` (rather than the default of the context root). |
-|**3**|We customize the domain name pattern (a regular expression) to be `^.+?\\.(\\w+\\.[a-z]+)$`. This allows sharing a session across domains and applications. If the regular expression does not match, no domain is set and the existing domain is used. If the regular expression matches, the first [grouping](https://docs.oracle.com/javase/tutorial/essential/regex/groups.html) is used as the domain. This means that a request to [https://child.example.com](https://child.example.com) sets the domain to `example.com`. However, a request to [http://localhost:8080/](http://localhost:8080/) or [https://192.168.1.100:8080/](https://192.168.1.100:8080/) leaves the cookie unset and, thus, still works in development without any changes being necessary for production.|
-
-| |You should only match on valid domain characters, since the domain name is reflected in the response. Doing so prevents a malicious user from performing such attacks as [HTTP Response Splitting](https://en.wikipedia.org/wiki/HTTP_response_splitting).|
-|---|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-
-### [](#api-cookieserializer-customization)Customizing `CookieSerializer`
-
-You can customize how the session cookie is written by using any of the following configuration options on the `DefaultCookieSerializer`.
-
-* `cookieName`: The name of the cookie to use.
- Default: `SESSION`.
-
-* `useSecureCookie`: Specifies whether a secure cookie should be used.
- Default: Use the value of `HttpServletRequest.isSecure()` at the time of creation.
-
-* `cookiePath`: The path of the cookie.
- Default: The context root.
-
-* `cookieMaxAge`: Specifies the max age of the cookie to be set at the time the session is created.
- Default: `-1`, which indicates the cookie should be removed when the browser is closed.
-
-* `jvmRoute`: Specifies a suffix to be appended to the session ID and included in the cookie.
- Used to identify which JVM to route to for session affinity.
- With some implementations (that is, Redis) this option provides no performance benefit.
- However, it can help with tracing logs of a particular user.
-
-* `domainName`: Allows specifying a specific domain name to be used for the cookie.
- This option is simple to understand but often requires a different configuration between development and production environments.
- See `domainNamePattern` as an alternative.
-
-* `domainNamePattern`: A case-insensitive pattern used to extract the domain name from the `HttpServletRequest#getServerName()`.
- The pattern should provide a single grouping that is used to extract the value of the cookie domain.
- If the regular expression does not match, no domain is set and the existing domain is used.
- If the regular expression matches, the first [grouping](https://docs.oracle.com/javase/tutorial/essential/regex/groups.html) is used as the domain.
-
-* `sameSite`: The value for the `SameSite` cookie directive.
- To disable the serialization of the `SameSite` cookie directive, you may set this value to `null`.
- Default: `Lax`
-
-| |You should only match on valid domain characters, since the domain name is reflected in the response. Doing so prevents a malicious user from performing such attacks as [HTTP Response Splitting](https://en.wikipedia.org/wiki/HTTP_response_splitting).|
-|---|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-
-## [](#custom-sessionrepository)Customizing `SessionRepository`
-
-Implementing a custom [`SessionRepository`](#api-sessionrepository) API should be a fairly straightforward task.
-Coupling the custom implementation with [`@EnableSpringHttpSession`](#api-enablespringhttpsession) support lets you reuse existing Spring Session configuration facilities and infrastructure.
-There are, however, a couple of aspects that deserve closer consideration.
-
-During the lifecycle of an HTTP request, the `HttpSession` is typically persisted to `SessionRepository` twice.
-The first persist operation is to ensure that the session is available to the client as soon as the client has access to the session ID, and it is also necessary to write after the session is committed because further modifications to the session might be made.
-Having this in mind, we generally recommend that a `SessionRepository` implementation keep track of changes to ensure that only deltas are saved.
-This is particularly important in highly concurrent environments, where multiple requests operate on the same `HttpSession` and, therefore, cause race conditions, with requests overriding each other’s changes to session attributes.
-All of the `SessionRepository` implementations provided by Spring Session use the described approach to persist session changes and can be used for guidance when you implement custom `SessionRepository`.
-
-Note that the same recommendations apply for implementing a custom [`ReactiveSessionRepository`](#api-reactivesessionrepository) as well.
-In this case, you should use the [`@EnableSpringWebSession`](#api-enablespringwebsession).
\ No newline at end of file
diff --git a/docs/spring-session/en/boot-findbyusername.md b/docs/spring-session/en/boot-findbyusername.md
deleted file mode 100644
index cd903736940fb62dd57b208e5a4de627789be660..0000000000000000000000000000000000000000
--- a/docs/spring-session/en/boot-findbyusername.md
+++ /dev/null
@@ -1,181 +0,0 @@
-# Spring Session - find by username
-
-This guide describes how to use Spring Session to find sessions by username.
-
-| |You can find the completed guide in the [findbyusername application](#findbyusername-sample).|
-|---|---------------------------------------------------------------------------------------------|
-
-[Index](../index.html)
-
-## [](#findbyusername-assumptions)Assumptions
-
-The guide assumes you have already added Spring Session to your application by using the built-in Redis configuration support.
-The guide also assumes you have already applied Spring Security to your application.
-However, we the guide is somewhat general purpose and can be applied to any technology with minimal changes, which we discuss later in the guide.
-
-| |If you need to learn how to add Spring Session to your project, see the listing of [samples and guides](../#samples)|
-|---|--------------------------------------------------------------------------------------------------------------------|
-
-## [](#_about_the_sample)About the Sample
-
-Our sample uses this feature to invalidate the users session that might have been compromised.
-Consider the following scenario:
-
-* User goes to library and authenticates to the application.
-
-* User goes home and realizes they forgot to log out.
-
-* User can log in and end the session from the library using clues like the location, created time, last accessed time, and so on.
-
-Would it not be nice if we could let the user invalidate the session at the library from any device with which they authenticate?
-This sample demonstrates how this is possible.
-
-## [](#findbyindexnamesessionrepository)Using `FindByIndexNameSessionRepository`
-
-To look up a user by their username, you must first choose a `SessionRepository` that implements [`FindByIndexNameSessionRepository`](../#api-findbyindexnamesessionrepository).
-Our sample application assumes that the Redis support is already set up, so we are ready to go.
-
-## [](#_mapping_the_user_name)Mapping the User Name
-
-`FindByIndexNameSessionRepository` can find a session only by the user name if the developer instructs Spring Session what user is associated with the `Session`.
-You can do so by ensuring that the session attribute with the name `FindByUsernameSessionRepository.PRINCIPAL_NAME_INDEX_NAME` is populated with the username.
-
-Generally speaking, you can do so with the following code immediately after the user authenticates:
-
-```
-String username = "username";
-this.session.setAttribute(FindByIndexNameSessionRepository.PRINCIPAL_NAME_INDEX_NAME, username);
-```
-
-## [](#_mapping_the_user_name_with_spring_security)Mapping the User Name with Spring Security
-
-Since we use Spring Security, the user name is automatically indexed for us.
-This means we need not perform any steps to ensure the user name is indexed.
-
-## [](#_adding_additional_data_to_the_session)Adding Additional Data to the Session
-
-It may be nice to associate additional information (such as the IP Address, the browser, location, and other details) to the session.
-Doing so makes it easier for the user to know which session they are looking at.
-
-To do so, determine which session attribute you want to use and what information you wish to provide.
-Then create a Java bean that is added as a session attribute.
-For example, our sample application includes the location and access type of the session, as the following listing shows:
-
-```
-public class SessionDetails implements Serializable {
-
- private String location;
-
- private String accessType;
-
- public String getLocation() {
- return this.location;
- }
-
- public void setLocation(String location) {
- this.location = location;
- }
-
- public String getAccessType() {
- return this.accessType;
- }
-
- public void setAccessType(String accessType) {
- this.accessType = accessType;
- }
-
- private static final long serialVersionUID = 8850489178248613501L;
-
-}
-```
-
-We then inject that information into the session on each HTTP request using a `SessionDetailsFilter`, as the following example shows:
-
-```
-@Override
-public void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain)
- throws IOException, ServletException {
- chain.doFilter(request, response);
-
- HttpSession session = request.getSession(false);
- if (session != null) {
- String remoteAddr = getRemoteAddress(request);
- String geoLocation = getGeoLocation(remoteAddr);
-
- SessionDetails details = new SessionDetails();
- details.setAccessType(request.getHeader("User-Agent"));
- details.setLocation(remoteAddr + " " + geoLocation);
-
- session.setAttribute("SESSION_DETAILS", details);
- }
-}
-```
-
-We obtain the information we want and then set the `SessionDetails` as an attribute in the `Session`.
-When we retrieve the `Session` by user name, we can then use the session to access our `SessionDetails` as we would any other session attribute.
-
-| |You might wonder why Spring Session does not provide `SessionDetails` functionality out of the box. We have two reasons. The first reason is that it is very trivial for applications to implement this themselves. The second reason is that the information that is populated in the session (and how frequently that information is updated) is highly application-dependent.|
-|---|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-
-## [](#_finding_sessions_for_a_specific_user)Finding sessions for a specific user
-
-We can now find all the sessions for a specific user.
-The following example shows how to do so:
-
-```
-@Autowired
-FindByIndexNameSessionRepository extends Session> sessions;
-
-@RequestMapping("/")
-public String index(Principal principal, Model model) {
- Collection extends Session> usersSessions = this.sessions.findByPrincipalName(principal.getName()).values();
- model.addAttribute("sessions", usersSessions);
- return "index";
-}
-```
-
-In our instance, we find all sessions for the currently logged in user.
-However, you can modify this for an administrator to use a form to specify which user to look up.
-
-## [](#findbyusername-sample)`findbyusername` Sample Application
-
-This section describes how to use the `findbyusername` sample application.
-
-### [](#_running_the_findbyusername_sample_application)Running the `findbyusername` Sample Application
-
-You can run the sample by obtaining the [source code](https://github.com/spring-projects/spring-session/archive/main.zip) and invoking the following command:
-
-```
-$ ./gradlew :spring-session-sample-boot-findbyusername:bootRun
-```
-
-| |For the sample to work, you must [install Redis 2.8+](https://redis.io/download) on localhost and run it with the default port (6379). Alternatively, you can update the `RedisConnectionFactory` to point to a Redis server. Another option is to use [Docker](https://www.docker.com/) to run Redis on localhost. See [Docker Redis repository](https://hub.docker.com/_/redis/) for detailed instructions.|
-|---|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-
-You should now be able to access the application at [http://localhost:8080/](http://localhost:8080/)
-
-### [](#_exploring_the_security_sample_application)Exploring the security Sample Application
-
-You can now try using the application. Enter the following to log in:
-
-* **Username** *user*
-
-* **Password** *password*
-
-Now click the **Login** button.
-You should now see a message indicating your are logged in with the user entered previously.
-You should also see a listing of active sessions for the currently logged in user.
-
-You can emulate the flow we discussed in the [About the Sample](#_about_the_sample) section by doing the following:
-
-* Open a new incognito window and navigate to [http://localhost:8080/](http://localhost:8080/)
-
-* Enter the following to log in:
-
- * **Username** *user*
-
- * **Password** *password*
-
-* End your original session.
-
-* Refresh the original window and see that you are logged out.
\ No newline at end of file
diff --git a/docs/spring-session/en/boot-jdbc.md b/docs/spring-session/en/boot-jdbc.md
deleted file mode 100644
index 64cbe47e9eb68bdfeccc6b8d0926687c56b0d6d7..0000000000000000000000000000000000000000
--- a/docs/spring-session/en/boot-jdbc.md
+++ /dev/null
@@ -1,127 +0,0 @@
-# Spring Session - Spring Boot
-
-This guide describes how to use Spring Session to transparently leverage a relational database to back a web application’s `HttpSession` when you use Spring Boot.
-
-| |You can find the completed guide in the [httpsession-jdbc-boot sample application](#httpsession-jdbc-boot-sample).|
-|---|------------------------------------------------------------------------------------------------------------------|
-
-[Index](../index.html)
-
-## [](#_updating_dependencies)Updating Dependencies
-
-Before you use Spring Session, you must update your dependencies.
-We assume you are working with a working Spring Boot web application.
-If you use Maven, you must add the following dependencies:
-
-pom.xml
-
-```
-
-
-
-
- org.springframework.session
- spring-session-jdbc
-
-
-```
-
-Spring Boot provides dependency management for Spring Session modules, so you need not explicitly declare the dependency version.
-
-## [](#httpsession-jdbc-boot-spring-configuration)Spring Boot Configuration
-
-After adding the required dependencies, we can create our Spring Boot configuration.
-Thanks to first-class auto configuration support, setting up Spring Session backed by a relational database is as simple as adding a single configuration property to your `application.properties`.
-The following listing shows how to do so:
-
-src/main/resources/application.properties
-
-```
-spring.session.store-type=jdbc # Session store type.
-```
-
-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 StoreType that you wish to use to store the sessions, as shows above.
-
-Under the hood, Spring Boot applies configuration that is equivalent to manually adding the `@EnableJdbcHttpSession` annotation.
-This creates a Spring bean with the name of `springSessionRepositoryFilter`. That bean implements `Filter`.
-The filter is in charge of replacing the `HttpSession` implementation to be backed by Spring Session.
-
-You can further customize by using `application.properties`.
-The following listing shows how to do so:
-
-src/main/resources/application.properties
-
-```
-server.servlet.session.timeout= # Session timeout. If a duration suffix is not specified, seconds are used.
-spring.session.jdbc.initialize-schema=embedded # Database schema initialization mode.
-spring.session.jdbc.schema=classpath:org/springframework/session/jdbc/[email protected]@[email protected]@.sql # Path to the SQL file to use to initialize the database schema.
-spring.session.jdbc.table-name=SPRING_SESSION # Name of the database table used to store sessions.
-```
-
-For more information, see the [Spring Session](https://docs.spring.io/spring-boot/docs/2.5.6/reference/htmlsingle/#boot-features-session) portion of the Spring Boot documentation.
-
-## [](#httpsession-jdbc-boot-configuration)Configuring the `DataSource`
-
-Spring Boot automatically creates a `DataSource` that connects Spring Session to an embedded instance of an H2 database.
-In a production environment, you need to update your configuration to point to your relational database.
-For example, you can include the following in your application.properties:
-
-src/main/resources/application.properties
-
-```
-spring.datasource.url= # JDBC URL of the database.
-spring.datasource.username= # Login username of the database.
-spring.datasource.password= # Login password of the database.
-```
-
-For more information, see the [Configure a DataSource](https://docs.spring.io/spring-boot/docs/2.5.6/reference/htmlsingle/#boot-features-configure-datasource) portion of the Spring Boot documentation.
-
-## [](#httpsession-jdbc-boot-servlet-configuration)Servlet Container Initialization
-
-Our [Spring Boot Configuration](#httpsession-jdbc-boot-spring-configuration) created a Spring bean named `springSessionRepositoryFilter` that implements `Filter`.
-The `springSessionRepositoryFilter` bean is responsible for replacing the `HttpSession` with a custom implementation that is backed by Spring Session.
-
-In order for our `Filter` to do its magic, Spring needs to load our `Config` class.
-Last, we need to ensure that our Servlet Container (that is, Tomcat) uses our `springSessionRepositoryFilter` for every request.
-Fortunately, Spring Boot takes care of both of these steps for us.
-
-## [](#httpsession-jdbc-boot-sample)`httpsession-jdbc-boot` Sample Application
-
-The httpsession-jdbc-boot Sample Application demonstrates how to use Spring Session to transparently leverage an H2 database to back a web application’s `HttpSession` when you use Spring Boot.
-
-### [](#httpsession-jdbc-boot-running)Running the `httpsession-jdbc-boot` Sample Application
-
-You can run the sample by obtaining the [source code](https://github.com/spring-projects/spring-session/archive/main.zip) and invoking the following command:
-
-```
-$ ./gradlew :spring-session-sample-boot-jdbc:bootRun
-```
-
-You should now be able to access the application at [http://localhost:8080/](http://localhost:8080/)
-
-### [](#httpsession-jdbc-boot-explore)Exploring the Security Sample Application
-
-You can now try using the application.
-To do so, enter the following to log in:
-
-* **Username** *user*
-
-* **Password** *password*
-
-Now click the **Login** button.
-You should now see a message indicating that your are logged in with the user entered previously.
-The user’s information is stored in the H2 database rather than Tomcat’s `HttpSession` implementation.
-
-### [](#httpsession-jdbc-boot-how)How Does It Work?
-
-Instead of using Tomcat’s `HttpSession`, we persist the values in the H2 database.
-Spring Session replaces the `HttpSession` with an implementation that is backed by a relational database.
-When Spring Security’s `SecurityContextPersistenceFilter` saves the `SecurityContext` to the `HttpSession`, it is then persisted into the H2 database.
-
-When a new `HttpSession` is created, Spring Session creates a cookie named `SESSION` in your browser. That cookie contains the ID of your session.
-You can view the cookies (with [Chrome](https://developers.google.com/web/tools/chrome-devtools/manage-data/cookies) or [Firefox](https://developer.mozilla.org/en-US/docs/Tools/Storage_Inspector)).
-
-You can remove the session by using the H2 web console available at: [http://localhost:8080/h2-console/](http://localhost:8080/h2-console/) (use `jdbc:h2:mem:testdb` for JDBC URL).
-
-Now you can visit the application at [http://localhost:8080/](http://localhost:8080/) and see that we are no longer authenticated.
\ No newline at end of file
diff --git a/docs/spring-session/en/boot-mongo.md b/docs/spring-session/en/boot-mongo.md
deleted file mode 100644
index e4ece3b55e9ba28f2866e79a7004669b50c0f7ed..0000000000000000000000000000000000000000
--- a/docs/spring-session/en/boot-mongo.md
+++ /dev/null
@@ -1,143 +0,0 @@
-# Spring Session - MongoDB Repositories
-
-This guide describes how to use Spring Session backed by MongoDB.
-
-| |The completed guide can be found in the [mongo sample application](#mongo-sample).|
-|---|----------------------------------------------------------------------------------|
-
-[Index](../index.html)
-
-## [](#_updating_dependencies)Updating Dependencies
-
-Before you use Spring Session MongoDB, you must ensure to update your dependencies.
-We assume you are working with a working Spring Boot web application.
-If you are using Maven, ensure to add the following dependencies:
-
-pom.xml
-
-```
-
-
-
- org.springframework.session
- spring-session-data-mongodb
-
-
-```
-
-Since We are using a SNAPSHOT version, we need to ensure to add the Spring Snapshot Maven Repository.
-Ensure you have the following in your pom.xml:
-
-pom.xml
-
-```
-
-
-
- spring-snapshot
- https://repo.spring.io/libs-snapshot
-
-
-```
-
-## [](#mongo-spring-configuration)Spring Configuration
-
-After adding the required dependencies, we can create our Spring configuration.
-The Spring configuration is responsible for creating a Servlet Filter that replaces the `HttpSession` implementation with an implementation backed by Spring Session.
-
-All you have to do is to add the following Spring Configuration:
-
-```
-@EnableMongoHttpSession (1)
-public class HttpSessionConfig {
-
- @Bean
- public JdkMongoSessionConverter jdkMongoSessionConverter() {
- return new JdkMongoSessionConverter(Duration.ofMinutes(30)); (2)
- }
-
-}
-```
-
-|**1**|The `@EnableMongoHttpSession` annotation creates a Spring Bean with the name of `springSessionRepositoryFilter` that implements Filter. This filter is what replaces the default `HttpSession` with the MongoDB-backed bean.|
-|-----|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-|**2**| Configures the session timeout to 30 minutes. |
-
-## [](#boot-mongo-configuration)Configuring the MongoDB Connection
-
-Spring Boot automatically creates a `MongoClient` that connects Spring Session to a MongoDB Server on localhost on port 27017 (default port).
-In a production environment you need to ensure to update your configuration to point to your MongoDB server.
-For example, you can include the following in your **application.properties**
-
-src/main/resources/application.properties
-
-```
-spring.data.mongodb.host=mongo-srv
-spring.data.mongodb.port=27018
-spring.data.mongodb.database=prod
-```
-
-For more information, refer to [Connecting to MongoDB](https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-connecting-to-mongodb) portion of the Spring Boot documentation.
-
-## [](#boot-servlet-configuration)Servlet Container Initialization
-
-Our [Spring Configuration](#boot-mongo-configuration) created a Spring Bean named `springSessionRepositoryFilter` that implements `Filter`.
-The `springSessionRepositoryFilter` bean is responsible for replacing the `HttpSession` with a custom implementation that is backed by Spring Session.
-
-In order for our `Filter` to do its magic, Spring needs to load our `Config` class.
-Last we need to ensure that our Servlet Container (i.e. Tomcat) uses our `springSessionRepositoryFilter` for every request.
-Fortunately, Spring Boot takes care of both of these steps for us.
-
-## [](#mongo-sample)MongoDB Sample Application
-
-The MongoDB Sample Application demonstrates how to use Spring Session to transparently leverage MongoDB to back a web application’s `HttpSession` when using Spring Boot.
-
-### [](#mongo-running)Running the MongoDB Sample Application
-
-You can run the sample by obtaining the [source code](https://github.com/spring-projects/spring-session/archive/main.zip) and invoking the following command:
-
-```
-$ ./gradlew :samples:mongo:bootRun
-```
-
-You should now be able to access the application at [http://localhost:8080/](http://localhost:8080/)
-
-### [](#boot-explore)Exploring the security Sample Application
-
-Try using the application. Enter the following to log in:
-
-* **Username** *user*
-
-* **Password** *password*
-
-Now click the **Login** button.
-You should now see a message indicating your are logged in with the user entered previously.
-The user’s information is stored in MongoDB rather than Tomcat’s `HttpSession` implementation.
-
-### [](#mongo-how)How does it work?
-
-Instead of using Tomcat’s `HttpSession`, we are actually persisting the values in Mongo.
-Spring Session replaces the `HttpSession` with an implementation that is backed by Mongo.
-When Spring Security’s `SecurityContextPersistenceFilter` saves the `SecurityContext` to the `HttpSession` it is then persisted into Mongo.
-
-When a new `HttpSession` is created, Spring Session creates a cookie named SESSION in your browser that contains the id of your session.
-Go ahead and view the cookies (click for help with [Chrome](https://developer.chrome.com/devtools/docs/resources#cookies) or [Firefox](https://getfirebug.com/wiki/index.php/Cookies_Panel#Cookies_List)).
-
-If you like, you can easily inspect the session using mongo client. For example, on a Linux based system you can type:
-
-| |The sample application uses an embedded MongoDB instance that listens on a randomly allocated port. The port used by embedded MongoDB together with exact command to connect to it is logged during application startup.|
-|---|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-
-```
-$ mongo --port ...
-> use test
-> db.sessions.find().pretty()
-```
-
-Alternatively, you can also delete the explicit key. Enter the following into your terminal ensuring to replace `60f17293-839b-477c-bb92-07a9c3658843` with the value of your SESSION cookie:
-
-```
-> db.sessions.remove({"_id":"60f17293-839b-477c-bb92-07a9c3658843"})
-```
-
-Now visit the application at [http://localhost:8080/](http://localhost:8080/) and observe that we are no longer authenticated.
\ No newline at end of file
diff --git a/docs/spring-session/en/boot-redis.md b/docs/spring-session/en/boot-redis.md
deleted file mode 100644
index 308f4dd1e1ff25a3c810ca567258c193a5de6070..0000000000000000000000000000000000000000
--- a/docs/spring-session/en/boot-redis.md
+++ /dev/null
@@ -1,139 +0,0 @@
-# Spring Session - Spring Boot
-
-This guide describes how to use Spring Session to transparently leverage Redis to back a web application’s `HttpSession` when you use Spring Boot.
-
-| |You can find the completed guide in the [boot sample application](#boot-sample).|
-|---|--------------------------------------------------------------------------------|
-
-[Index](../index.html)
-
-## [](#_updating_dependencies)Updating Dependencies
-
-Before you use Spring Session, you must ensure your dependencies.
-We assume you are working with a working Spring Boot web application.
-If you are using Maven, you must add the following dependencies:
-
-pom.xml
-
-```
-
-
-
-
- org.springframework.session
- spring-session-data-redis
-
-
-```
-
-Spring Boot provides dependency management for Spring Session modules, so you need not explicitly declare dependency version.
-
-## [](#boot-spring-configuration)Spring Boot Configuration
-
-After adding the required dependencies, we can create our Spring Boot configuration.
-Thanks to first-class auto configuration support, setting up Spring Session backed by Redis is as simple as adding a single configuration property to your `application.properties`, as the following listing shows:
-
-src/main/resources/application.properties
-
-```
-spring.session.store-type=redis # Session store type.
-```
-
-Under the hood, Spring Boot applies configuration that is equivalent to manually adding `@EnableRedisHttpSession` annotation.
-This creates a Spring bean with the name of `springSessionRepositoryFilter` that implements `Filter`.
-The filter is in charge of replacing the `HttpSession` implementation to be backed by Spring Session.
-
-Further customization is possible by using `application.properties`, as the following listing shows:
-
-src/main/resources/application.properties
-
-```
-server.servlet.session.timeout= # Session timeout. If a duration suffix is not specified, seconds is used.
-spring.session.redis.flush-mode=on_save # Sessions flush mode.
-spring.session.redis.namespace=spring:session # Namespace for keys used to store sessions.
-```
-
-For more information, see the [Spring Session](https://docs.spring.io/spring-boot/docs/2.5.6/reference/htmlsingle/#boot-features-session) portion of the Spring Boot documentation.
-
-## [](#boot-redis-configuration)Configuring the Redis Connection
-
-Spring Boot automatically creates a `RedisConnectionFactory` that connects Spring Session to a Redis Server on localhost on port 6379 (default port).
-In a production environment, you need to update your configuration to point to your Redis server.
-For example, you can include the following in your application.properties:
-
-src/main/resources/application.properties
-
-```
-spring.redis.host=localhost # Redis server host.
-spring.redis.password= # Login password of the redis server.
-spring.redis.port=6379 # Redis server port.
-```
-
-For more information, see the [Connecting to Redis](https://docs.spring.io/spring-boot/docs/2.5.6/reference/htmlsingle/#boot-features-connecting-to-redis) portion of the Spring Boot documentation.
-
-## [](#boot-servlet-configuration)Servlet Container Initialization
-
-Our [Spring Boot Configuration](#boot-spring-configuration) created a Spring bean named `springSessionRepositoryFilter` that implements `Filter`.
-The `springSessionRepositoryFilter` bean is responsible for replacing the `HttpSession` with a custom implementation that is backed by Spring Session.
-
-In order for our `Filter` to do its magic, Spring needs to load our `Config` class.
-Last, we need to ensure that our servlet container (that is, Tomcat) uses our `springSessionRepositoryFilter` for every request.
-Fortunately, Spring Boot takes care of both of these steps for us.
-
-## [](#boot-sample)Boot Sample Application
-
-The Boot Sample Application demonstrates how to use Spring Session to transparently leverage Redis to back a web application’s `HttpSession` when you use Spring Boot.
-
-### [](#boot-running)Running the Boot Sample Application
-
-You can run the sample by obtaining the [source code](https://github.com/spring-projects/spring-session/archive/main.zip) and invoking the following command:
-
-```
-$ ./gradlew :spring-session-sample-boot-redis:bootRun
-```
-
-| |For the sample to work, you must [install Redis 2.8+](https://redis.io/download) on localhost and run it with the default port (6379). Alternatively, you can update the `RedisConnectionFactory` to point to a Redis server. Another option is to use [Docker](https://www.docker.com/) to run Redis on localhost. See [Docker Redis repository](https://hub.docker.com/_/redis/) for detailed instructions.|
-|---|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-
-You should now be able to access the application at [http://localhost:8080/](http://localhost:8080/)
-
-### [](#boot-explore)Exploring the `security` Sample Application
-
-Now you can try using the application. Enter the following to log in:
-
-* **Username** *user*
-
-* **Password** *password*
-
-Now click the **Login** button.
-You should now see a message indicating your are logged in with the user entered previously.
-The user’s information is stored in Redis rather than Tomcat’s `HttpSession` implementation.
-
-### [](#boot-how)How Does It Work?
-
-Instead of using Tomcat’s `HttpSession`, we persist the values in Redis.
-Spring Session replaces the `HttpSession` with an implementation that is backed by Redis.
-When Spring Security’s `SecurityContextPersistenceFilter` saves the `SecurityContext` to the `HttpSession`, it is then persisted into Redis.
-
-When a new `HttpSession` is created, Spring Session creates a cookie named `SESSION` in your browser.
-That cookie contains the ID of your session.
-You can view the cookies (with [Chrome](https://developers.google.com/web/tools/chrome-devtools/manage-data/cookies) or [Firefox](https://developer.mozilla.org/en-US/docs/Tools/Storage_Inspector)).
-
-You can remove the session by using redis-cli.
-For example, on a Linux based system you can type the following:
-
-```
- $ redis-cli keys '*' | xargs redis-cli del
-```
-
-| |The Redis documentation has instructions for [installing redis-cli](https://redis.io/topics/quickstart).|
-|---|--------------------------------------------------------------------------------------------------------|
-
-Alternatively, you can also delete the explicit key.
-To do so, enter the following into your terminal, being sure to replace `7e8383a4-082c-4ffe-a4bc-c40fd3363c5e` with the value of your `SESSION` cookie:
-
-```
- $ redis-cli del spring:session:sessions:7e8383a4-082c-4ffe-a4bc-c40fd3363c5e
-```
-
-Now you can visit the application at [http://localhost:8080/](http://localhost:8080/) and observe that we are no longer authenticated.
\ No newline at end of file
diff --git a/docs/spring-session/en/boot-webflux-custom-cookie.md b/docs/spring-session/en/boot-webflux-custom-cookie.md
deleted file mode 100644
index bf990a1796c082b944d76415b0181175f24bb007..0000000000000000000000000000000000000000
--- a/docs/spring-session/en/boot-webflux-custom-cookie.md
+++ /dev/null
@@ -1,62 +0,0 @@
-# Spring Session - WebFlux with Custom Cookie
-
-This guide describes how to configure Spring Session to use custom cookies in a WebFlux based application.
-The guide assumes you have already set up Spring Session in your project using your chosen data store. For example, [HttpSession with Redis](./boot-redis.html).
-
-| |You can find the completed guide in the [WebFlux Custom Cookie sample application](#webflux-custom-cookie-sample).|
-|---|------------------------------------------------------------------------------------------------------------------|
-
-[Index](../index.html)
-
-## [](#webflux-custom-cookie-spring-configuration)Spring Boot Configuration
-
-Once you have set up Spring Session, you can customize how the session cookie is written by exposing a `WebSessionIdResolver` as a Spring bean.
-Spring Session uses a `CookieWebSessionIdResolver` by default.
-Exposing the `WebSessionIdResolver` as a Spring bean augments the existing configuration when you use configurations like `@EnableRedisHttpSession`.
-The following example shows how to customize Spring Session’s cookie:
-
-```
- @Bean
- public WebSessionIdResolver webSessionIdResolver() {
- CookieWebSessionIdResolver resolver = new CookieWebSessionIdResolver();
- resolver.setCookieName("JSESSIONID"); (1)
- resolver.addCookieInitializer((builder) -> builder.path("/")); (2)
- resolver.addCookieInitializer((builder) -> builder.sameSite("Strict")); (3)
- return resolver;
- }
-```
-
-|**1**| We customize the name of the cookie to be `JSESSIONID`. |
-|-----|--------------------------------------------------------------------------------------------|
-|**2**|We customize the path of the cookie to be `/` (rather than the default of the context root).|
-|**3**| We customize the `SameSite` cookie directive to be `Strict`. |
-
-## [](#webflux-custom-cookie-sample)`webflux-custom-cookie` Sample Application
-
-This section describes how to work with the `webflux-custom-cookie` sample application.
-
-### [](#_running_the_webflux_custom_cookie_sample_application)Running the `webflux-custom-cookie` Sample Application
-
-You can run the sample by obtaining the [source code](https://github.com/spring-projects/spring-session/archive/main.zip) and invoking the following command:
-
-```
-$ ./gradlew :spring-session-sample-boot-webflux-custom-cookie:bootRun
-```
-
-| |For the sample to work, you must [install Redis 2.8+](https://redis.io/download) on localhost and run it with the default port (6379). Alternatively, you can update the `RedisConnectionFactory` to point to a Redis server. Another option is to use [Docker](https://www.docker.com/) to run Redis on localhost. See [Docker Redis repository](https://hub.docker.com/_/redis/) for detailed instructions.|
-|---|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-
-You should now be able to access the application at [http://localhost:8080/](http://localhost:8080/)
-
-### [](#_exploring_the_webflux_custom_cookie_sample_application)Exploring the `webflux-custom-cookie` Sample Application
-
-Now you can use the application. Fill out the form with the following information:
-
-* **Attribute Name:** *username*
-
-* **Attribute Value:** *rob*
-
-Now click the **Set Attribute** button.
-You should now see the values displayed in the table.
-
-If you look at the cookies for the application, you can see the cookie is saved to the custom name of `JSESSIONID`.
\ No newline at end of file
diff --git a/docs/spring-session/en/boot-websocket.md b/docs/spring-session/en/boot-websocket.md
deleted file mode 100644
index 3cad55b4bd72531ccd2106fdf2cc6dad14bfd6bb..0000000000000000000000000000000000000000
--- a/docs/spring-session/en/boot-websocket.md
+++ /dev/null
@@ -1,143 +0,0 @@
-# Spring Session - WebSocket
-
-This guide describes how to use Spring Session to ensure that WebSocket messages keep your HttpSession alive.
-
-| |Spring Session’s WebSocket support works only with Spring’s WebSocket support. Specifically,it does not work with using [JSR-356](https://www.jcp.org/en/jsr/detail?id=356) directly, because JSR-356 does not have a mechanism for intercepting incoming WebSocket messages.|
-|---|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-
-[Index](../index.html)
-
-## [](#_httpsession_setup)HttpSession Setup
-
-The first step is to integrate Spring Session with the HttpSession. These steps are already outlined in the [HttpSession with Redis Guide](./boot-redis.html).
-
-Please make sure you have already integrated Spring Session with HttpSession before proceeding.
-
-## [](#websocket-spring-configuration)Spring Configuration
-
-In a typical Spring WebSocket application, you would implement `WebSocketMessageBrokerConfigurer`.
-For example, the configuration might look something like the following:
-
-```
-@Configuration
-@EnableScheduling
-@EnableWebSocketMessageBroker
-public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
-
- @Override
- public void registerStompEndpoints(StompEndpointRegistry registry) {
- registry.addEndpoint("/messages").withSockJS();
- }
-
- @Override
- public void configureMessageBroker(MessageBrokerRegistry registry) {
- registry.enableSimpleBroker("/queue/", "/topic/");
- registry.setApplicationDestinationPrefixes("/app");
- }
-
-}
-```
-
-We can update our configuration to use Spring Session’s WebSocket support.
-The following example shows how to do so:
-
-src/main/java/samples/config/WebSocketConfig.java
-
-```
-@Configuration
-@EnableScheduling
-@EnableWebSocketMessageBroker
-public class WebSocketConfig extends AbstractSessionWebSocketMessageBrokerConfigurer { (1)
-
- @Override
- protected void configureStompEndpoints(StompEndpointRegistry registry) { (2)
- registry.addEndpoint("/messages").withSockJS();
- }
-
- @Override
- public void configureMessageBroker(MessageBrokerRegistry registry) {
- registry.enableSimpleBroker("/queue/", "/topic/");
- registry.setApplicationDestinationPrefixes("/app");
- }
-
-}
-```
-
-To hook in the Spring Session support we only need to change two things:
-
-|**1**|Instead of implementing `WebSocketMessageBrokerConfigurer`, we extend `AbstractSessionWebSocketMessageBrokerConfigurer`|
-|-----|-----------------------------------------------------------------------------------------------------------------------|
-|**2**| We rename the `registerStompEndpoints` method to `configureStompEndpoints` |
-
-What does `AbstractSessionWebSocketMessageBrokerConfigurer` do behind the scenes?
-
-* `WebSocketConnectHandlerDecoratorFactory` is added as a `WebSocketHandlerDecoratorFactory` to `WebSocketTransportRegistration`.
- This ensures a custom `SessionConnectEvent` is fired that contains the `WebSocketSession`.
- The `WebSocketSession` is necessary to end any WebSocket connections that are still open when a Spring Session is ended.
-
-* `SessionRepositoryMessageInterceptor` is added as a `HandshakeInterceptor` to every `StompWebSocketEndpointRegistration`.
- This ensures that the `Session` is added to the WebSocket properties to enable updating the last accessed time.
-
-* `SessionRepositoryMessageInterceptor` is added as a `ChannelInterceptor` to our inbound `ChannelRegistration`.
- This ensures that every time an inbound message is received, that the last accessed time of our Spring Session is updated.
-
-* `WebSocketRegistryListener` is created as a Spring bean.
- This ensures that we have a mapping of all of the `Session` IDs to the corresponding WebSocket connections.
- By maintaining this mapping, we can close all the WebSocket connections when a Spring Session (HttpSession) is ended.
-
-## [](#websocket-sample)`websocket` Sample Application
-
-The `websocket` sample application demonstrates how to use Spring Session with WebSockets.
-
-### [](#_running_the_websocket_sample_application)Running the `websocket` Sample Application
-
-You can run the sample by obtaining the [source code](https://github.com/spring-projects/spring-session/archive/main.zip) and invoking the following command:
-
-```
-$ ./gradlew :spring-session-sample-boot-websocket:bootRun
-```
-
-| |For the purposes of testing session expiration, you may want to change the session expiration to be 1 minute (the default is 30 minutes) by adding the following configuration property before starting the application: src/main/resources/application.properties ``` server.servlet.session.timeout=1m # Session timeout. If a duration suffix is not specified, seconds will be used. ```|
-|---|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-
-| |For the sample to work, you must [install Redis 2.8+](https://redis.io/download) on localhost and run it with the default port (6379). Alternatively, you can update the `RedisConnectionFactory` to point to a Redis server. Another option is to use [Docker](https://www.docker.com/) to run Redis on localhost. See [Docker Redis repository](https://hub.docker.com/_/redis/) for detailed instructions.|
-|---|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-
-You should now be able to access the application at [http://localhost:8080/](http://localhost:8080/)
-
-### [](#_exploring_the_websocket_sample_application)Exploring the `websocket` Sample Application
-
-Now you can try using the application. Authenticate with the following information:
-
-* **Username** *rob*
-
-* **Password** *password*
-
-Now click the **Login** button. You should now be authenticated as the user **rob**.
-
-Open an incognito window and access [http://localhost:8080/](http://localhost:8080/)
-
-You are prompted with a login form. Authenticate with the following information:
-
-* **Username** *luke*
-
-* **Password** *password*
-
-Now send a message from rob to luke. The message should appear.
-
-Wait for two minutes and try sending a message from rob to luke again.
-You can see that the message is no longer sent.
-
-| |Why two minutes? Spring Session expires in 60 seconds, but the notification from Redis is not guaranteed to happen within 60 seconds. To ensure the socket is closed in a reasonable amount of time, Spring Session runs a background task every minute at 00 seconds that forcibly cleans up any expired sessions. This means you need to wait at most two minutes before the WebSocket connection is closed.|
-|---|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-
-You can now try accessing [http://localhost:8080/](http://localhost:8080/)You are prompted to authenticate again.
-This demonstrates that the session properly expires.
-
-Now repeat the same exercise, but instead of waiting two minutes, send a message from each of the users every 30 seconds.
-You can see that the messages continue to be sent.
-Try accessing [http://localhost:8080/](http://localhost:8080/)You are not prompted to authenticate again.
-This demonstrates the session is kept alive.
-
-| |Only messages sent from a user keep the session alive. This is because only messages coming from a user imply user activity. Received messages do not imply activity and, thus, do not renew the session expiration.|
-|---|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
\ No newline at end of file
diff --git a/docs/spring-session/en/http-session.md b/docs/spring-session/en/http-session.md
deleted file mode 100644
index 59616419c5b428259ba3fac5e788b7c84d133ef5..0000000000000000000000000000000000000000
--- a/docs/spring-session/en/http-session.md
+++ /dev/null
@@ -1,738 +0,0 @@
-# `HttpSession` Integration
-
-Spring Session provides transparent integration with `HttpSession`.
-This means that developers can switch the `HttpSession` implementation out with an implementation that is backed by Spring Session.
-
-## [](#httpsession-why)Why Spring Session and `HttpSession`?
-
-We have already mentioned that Spring Session provides transparent integration with `HttpSession`, but what benefits do we get out of this?
-
-* **Clustered Sessions**: Spring Session makes it trivial to support [clustered sessions](#httpsession-redis) without being tied to an application container specific solution.
-
-* **RESTful APIs**: Spring Session lets providing session IDs in headers work with [RESTful APIs](#httpsession-rest)
-
-## [](#httpsession-redis)`HttpSession` with Redis
-
-Using Spring Session with `HttpSession` is enabled by adding a Servlet Filter before anything that uses the `HttpSession`.
-You can choose from enabling this by using either:
-
-* [Java-based Configuration](#httpsession-redis-jc)
-
-* [XML-based Configuration](#httpsession-redis-xml)
-
-### [](#httpsession-redis-jc)Redis Java-based Configuration
-
-This section describes how to use Redis to back `HttpSession` by using Java based configuration.
-
-| |The [ HttpSession Sample](samples.html#samples) provides a working sample of how to integrate Spring Session and `HttpSession` by using Java configuration. You can read the basic steps for integration in the next few sections, but we encourage you to follow along with the detailed HttpSession Guide when integrating with your own application.|
-|---|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-
-#### [](#httpsession-spring-configuration)Spring Java Configuration
-
-After adding the required dependencies, we can create our Spring configuration.
-The Spring configuration is responsible for creating a servlet filter that replaces the `HttpSession` implementation with an implementation backed by Spring Session.
-To do so, add the following Spring Configuration:
-
-```
-@EnableRedisHttpSession (1)
-public class Config {
-
- @Bean
- public LettuceConnectionFactory connectionFactory() {
- return new LettuceConnectionFactory(); (2)
- }
-
-}
-```
-
-|**1**| The `@EnableRedisHttpSession` annotation creates a Spring Bean with the name of `springSessionRepositoryFilter` that implements `Filter`. The filter is in charge of replacing the `HttpSession` implementation to be backed by Spring Session. In this instance, Spring Session is backed by Redis. |
-|-----|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-|**2**|We create a `RedisConnectionFactory` that connects Spring Session to the Redis Server. We configure the connection to connect to localhost on the default port (6379). For more information on configuring Spring Data Redis, see the [reference documentation](https://docs.spring.io/spring-data/data-redis/docs/2.6.2/reference/html/).|
-
-#### [](#_java_servlet_container_initialization)Java Servlet Container Initialization
-
-Our [Spring Configuration](#httpsession-spring-configuration) created a Spring Bean named `springSessionRepositoryFilter` that implements `Filter`.
-The `springSessionRepositoryFilter` bean is responsible for replacing the `HttpSession` with a custom implementation that is backed by Spring Session.
-
-In order for our `Filter` to do its magic, Spring needs to load our `Config` class.
-Last, we need to ensure that our Servlet Container (that is, Tomcat) uses our `springSessionRepositoryFilter` for every request.
-Fortunately, Spring Session provides a utility class named `AbstractHttpSessionApplicationInitializer` to make both of these steps easy.
-The following shows an example:
-
-src/main/java/sample/Initializer.java
-
-```
-public class Initializer extends AbstractHttpSessionApplicationInitializer { (1)
-
- public Initializer() {
- super(Config.class); (2)
- }
-
-}
-```
-
-| |The name of our class (`Initializer`) does not matter. What is important is that we extend `AbstractHttpSessionApplicationInitializer`.|
-|---|---------------------------------------------------------------------------------------------------------------------------------------|
-
-|**1**|The first step is to extend `AbstractHttpSessionApplicationInitializer`. Doing so ensures that the Spring Bean by the name of `springSessionRepositoryFilter` is registered with our Servlet Container for every request.|
-|-----|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-|**2**| `AbstractHttpSessionApplicationInitializer` also provides a mechanism to ensure Spring loads our `Config`. |
-
-### [](#httpsession-redis-xml)Redis XML-based Configuration
-
-This section describes how to use Redis to back `HttpSession` by using XML based configuration.
-
-| |The [ HttpSession XML Sample](samples.html#samples) provides a working sample of how to integrate Spring Session and `HttpSession` using XML configuration. You can read the basic steps for integration in the next few sections, but we encourage you to follow along with the detailed HttpSession XML Guide when integrating with your own application.|
-|---|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-
-#### [](#httpsession-xml-spring-configuration)Spring XML Configuration
-
-After adding the required dependencies, we can create our Spring configuration.
-The Spring configuration is responsible for creating a servlet filter that replaces the `HttpSession` implementation with an implementation backed by Spring Session.
-To do so, add the following Spring Configuration:
-
-src/main/webapp/WEB-INF/spring/session.xml
-
-```
-(1)
-
-
-
-(2)
-
-```
-
-|**1**|We use the combination of ` ` and `RedisHttpSessionConfiguration` because Spring Session does not yet provide XML Namespace support (see [gh-104](https://github.com/spring-projects/spring-session/issues/104)). This creates a Spring Bean with the name of `springSessionRepositoryFilter` that implements `Filter`. The filter is in charge of replacing the `HttpSession` implementation to be backed by Spring Session. In this instance, Spring Session is backed by Redis.|
-|-----|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-|**2**| We create a `RedisConnectionFactory` that connects Spring Session to the Redis Server. We configure the connection to connect to localhost on the default port (6379) For more information on configuring Spring Data Redis, see the [reference documentation](https://docs.spring.io/spring-data/data-redis/docs/2.6.2/reference/html/). |
-
-#### [](#_xml_servlet_container_initialization)XML Servlet Container Initialization
-
-Our [Spring Configuration](#httpsession-xml-spring-configuration) created a Spring Bean named `springSessionRepositoryFilter` that implements `Filter`.
-The `springSessionRepositoryFilter` bean is responsible for replacing the `HttpSession` with a custom implementation that is backed by Spring Session.
-
-In order for our `Filter` to do its magic, we need to instruct Spring to load our `session.xml` configuration.
-We can do so with the following configuration:
-
-src/main/webapp/WEB-INF/web.xml
-
-```
-
- contextConfigLocation
-
- /WEB-INF/spring/session.xml
-
-
-
-
- org.springframework.web.context.ContextLoaderListener
-
-
-```
-
-The [`ContextLoaderListener`](https://docs.spring.io/spring/docs/5.3.16/spring-framework-reference/core.html#context-create) reads the contextConfigLocation and picks up our session.xml configuration.
-
-Last, we need to ensure that our Servlet Container (that is, Tomcat) uses our `springSessionRepositoryFilter` for every request.
-The following snippet performs this last step for us:
-
-src/main/webapp/WEB-INF/web.xml
-
-```
-
- springSessionRepositoryFilter
- org.springframework.web.filter.DelegatingFilterProxy
-
-
- springSessionRepositoryFilter
- /*
- REQUEST
- ERROR
-
-```
-
-The [`DelegatingFilterProxy`](https://docs.spring.io/spring-framework/docs/5.3.16/javadoc-api/org/springframework/web/filter/DelegatingFilterProxy.html) looks up a Bean by the name of `springSessionRepositoryFilter` and cast it to a `Filter`.
-For every request that `DelegatingFilterProxy` is invoked, the `springSessionRepositoryFilter` is invoked.
-
-### [](#httpsession-mongo)HttpSession with Mongo
-
-Using Spring Session with `HttpSession` is enabled by adding a Servlet Filter before anything that uses the `HttpSession`.
-
-This section describes how to use Mongo to back `HttpSession` using Java based configuration.
-
-| |The [HttpSession Mongo Sample](#samples) provides a working sample on how to integrate Spring Session and `HttpSession` using Java configuration. You can read the basic steps for integration below, but you are encouraged to follow along with the detailed HttpSession Guide when integrating with your own application.|
-|---|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-
-All you have to do is to add the following Spring Configuration:
-
-```
-@EnableMongoHttpSession (1)
-public class HttpSessionConfig {
-
- @Bean
- public JdkMongoSessionConverter jdkMongoSessionConverter() {
- return new JdkMongoSessionConverter(Duration.ofMinutes(30)); (2)
- }
-
-}
-```
-
-|**1**|The `@EnableMongoHttpSession` annotation creates a Spring Bean with the name of `springSessionRepositoryFilter` that implements Filter. This filter is what replaces the default `HttpSession` with the MongoDB-backed bean.|
-|-----|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-|**2**| Configures the session timeout to 30 minutes. |
-
-#### [](#_session_serialization_mechanisms)Session serialization mechanisms
-
-To be able to persist session objects in MongoDB we need to provide the serialization/deserialization mechanism.
-
-By default, Spring Session MongoDB will use `JdkMongoSessionConverter`.
-
-However, you may switch to `JacksonMongoSessionConverter` by merely adding the following code to your Boot app:
-
-```
-@Bean
-JacksonMongoSessionConverter mongoSessionConverter() {
- return new JacksonMongoSessionConverter();
-}
-```
-
-##### [](#_jacksonmongosessionconverter)JacksonMongoSessionConverter
-
-This mechanism uses Jackson to serialize session objects to/from JSON.
-
-By creating the following bean:
-
-```
-@Bean
-JacksonMongoSessionConverter mongoSessionConverter() {
- return new JacksonMongoSessionConverter();
-}
-```
-
-…you are able to switch from the default (JDK-based serialization) to using Jackson.
-
-| |If you are integrating with Spring Security (by storing your sessions in MongoDB), this configuration will register the proper whitelisted components so Spring Security works properly.|
-|---|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-
-If you would like to provide custom Jackson modules you can do it by explicitly registering modules as shown below:
-
-```
-@Configuration
-@EnableMongoHttpSession
-static class Config extends BaseConfig {
-
- @Bean
- AbstractMongoSessionConverter mongoSessionConverter() {
- return new JacksonMongoSessionConverter(Collections.singletonList(new GeoModule()));
- }
-
-}
-```
-
-##### [](#_jdkmongosessionconverter)JdkMongoSessionConverter
-
-`JdkMongoSessionConverter` uses standard Java serialization to persist session attributes map to MongoDB in a binary form.
-However, standard session elements like id, access time, etc are still written as a plain Mongo objects and can be read and queried without additional effort.`JdkMongoSessionConverter` is used if no explicit `AbstractMongoSessionConverter` Bean has been defined.
-
-There is also a constructor taking `Serializer` and `Deserializer` objects, allowing you to pass custom implementations, which is especially important when you want to use non-default classloader.
-
-## [](#httpsession-jdbc)`HttpSession` with JDBC
-
-You can use Spring Session with `HttpSession` by adding a servlet filter before anything that uses the `HttpSession`.
-You can choose to do in any of the following ways:
-
-* [Java-based Configuration](#httpsession-jdbc-jc)
-
-* [XML-based Configuration](#httpsession-jdbc-xml)
-
-* [Spring Boot-based Configuration](#httpsession-jdbc-boot)
-
-### [](#httpsession-jdbc-jc)JDBC Java-based Configuration
-
-This section describes how to use a relational database to back `HttpSession` when you use Java-based configuration.
-
-| |The [ HttpSession JDBC Sample](samples.html#samples) provides a working sample of how to integrate Spring Session and `HttpSession` by using Java configuration. You can read the basic steps for integration in the next few sections, but we encouraged you to follow along with the detailed HttpSession JDBC Guide when integrating with your own application.|
-|---|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-
-#### [](#httpsession-jdbc-spring-configuration)Spring Java Configuration
-
-After adding the required dependencies, we can create our Spring configuration.
-The Spring configuration is responsible for creating a Servlet Filter that replaces the `HttpSession` implementation with an implementation backed by Spring Session.
-To do so, add the following Spring Configuration:
-
-```
-@EnableJdbcHttpSession (1)
-public class Config {
-
- @Bean
- public EmbeddedDatabase dataSource() {
- return new EmbeddedDatabaseBuilder() (2)
- .setType(EmbeddedDatabaseType.H2).addScript("org/springframework/session/jdbc/schema-h2.sql").build();
- }
-
- @Bean
- public PlatformTransactionManager transactionManager(DataSource dataSource) {
- return new DataSourceTransactionManager(dataSource); (3)
- }
-
-}
-```
-
-|**1**|The `@EnableJdbcHttpSession` annotation creates a Spring Bean with the name of `springSessionRepositoryFilter`. That bean implements `Filter`. The filter is in charge of replacing the `HttpSession` implementation to be backed by Spring Session. In this instance, Spring Session is backed by a relational database.|
-|-----|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-|**2**| We create a `dataSource` that connects Spring Session to an embedded instance of an H2 database. We configure the H2 database to create database tables by using the SQL script that is included in Spring Session. |
-|**3**| We create a `transactionManager` that manages transactions for previously configured `dataSource`. |
-
-For additional information on how to configure data access related concerns, see the [Spring Framework Reference Documentation](https://docs.spring.io/spring/docs/5.3.16/spring-framework-reference/data-access.html).
-
-#### [](#_java_servlet_container_initialization_2)Java Servlet Container Initialization
-
-Our [Spring Configuration](#httpsession-jdbc-spring-configuration) created a Spring bean named `springSessionRepositoryFilter` that implements `Filter`.
-The `springSessionRepositoryFilter` bean is responsible for replacing the `HttpSession` with a custom implementation that is backed by Spring Session.
-
-In order for our `Filter` to do its magic, Spring needs to load our `Config` class.
-Last, we need to ensure that our Servlet Container (that is, Tomcat) uses our `springSessionRepositoryFilter` for every request.
-Fortunately, Spring Session provides a utility class named `AbstractHttpSessionApplicationInitializer` to make both of these steps easy.
-The following example shows how to do so:
-
-src/main/java/sample/Initializer.java
-
-```
-public class Initializer extends AbstractHttpSessionApplicationInitializer { (1)
-
- public Initializer() {
- super(Config.class); (2)
- }
-
-}
-```
-
-| |The name of our class (Initializer) does not matter. What is important is that we extend `AbstractHttpSessionApplicationInitializer`.|
-|---|-----------------------------------------------------------------------------------------------------------------------------------------|
-
-|**1**|The first step is to extend `AbstractHttpSessionApplicationInitializer`. Doing so ensures that the Spring bean named `springSessionRepositoryFilter` is registered with our Servlet Container for every request.|
-|-----|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-|**2**| `AbstractHttpSessionApplicationInitializer` also provides a mechanism to ensure Spring loads our `Config`. |
-
-#### [](#_multiple_datasources)Multiple DataSources
-
-Spring Session provides the `@SpringSessionDataSource` qualifier, allowing you to explicitly declare which `DataSource` bean should be injected in `JdbcIndexedSessionRepository`.
-This is particularly useful in scenarios with multiple `DataSource` beans present in the application context.
-
-The following example shows how to do so:
-
-Config.java
-
-```
-@EnableJdbcHttpSession
-public class Config {
-
- @Bean
- @SpringSessionDataSource (1)
- public EmbeddedDatabase firstDataSource() {
- return new EmbeddedDatabaseBuilder()
- .setType(EmbeddedDatabaseType.H2).addScript("org/springframework/session/jdbc/schema-h2.sql").build();
- }
-
- @Bean
- public HikariDataSource secondDataSource() {
- // ...
- }
-}
-```
-
-|**1**|This qualifier declares that firstDataSource is to be used by Spring Session.|
-|-----|-----------------------------------------------------------------------------|
-
-### [](#httpsession-jdbc-xml)JDBC XML-based Configuration
-
-This section describes how to use a relational database to back `HttpSession` when you use XML based configuration.
-
-| |The [ HttpSession JDBC XML Sample](samples.html#samples) provides a working sample of how to integrate Spring Session and `HttpSession` by using XML configuration. You can read the basic steps for integration in the next few sections, but we encourage you to follow along with the detailed HttpSession JDBC XML Guide when integrating with your own application.|
-|---|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-
-#### [](#httpsession-jdbc-xml-spring-configuration)Spring XML Configuration
-
-After adding the required dependencies, we can create our Spring configuration.
-The Spring configuration is responsible for creating a servlet filter that replaces the `HttpSession` implementation with an implementation backed by Spring Session.
-The following listing shows how to add the following Spring Configuration:
-
-src/main/webapp/WEB-INF/spring/session.xml
-
-```
-(1)
-
-
-
-(2)
-
-
-
-
-(3)
-
-
-
-```
-
-|**1**|We use the combination of ` ` and `JdbcHttpSessionConfiguration` because Spring Session does not yet provide XML Namespace support (see [gh-104](https://github.com/spring-projects/spring-session/issues/104)). This creates a Spring bean with the name of `springSessionRepositoryFilter`. That bean implements `Filter`. The filter is in charge of replacing the `HttpSession` implementation to be backed by Spring Session. In this instance, Spring Session is backed by a relational database.|
-|-----|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-|**2**| We create a `dataSource` that connects Spring Session to an embedded instance of an H2 database. We configure the H2 database to create database tables by using the SQL script that is included in Spring Session. |
-|**3**| We create a `transactionManager` that manages transactions for previously configured `dataSource`. |
-
-For additional information on how to configure data access-related concerns, see the [Spring Framework Reference Documentation](https://docs.spring.io/spring/docs/5.3.16/spring-framework-reference/data-access.html).
-
-#### [](#_xml_servlet_container_initialization_2)XML Servlet Container Initialization
-
-Our [Spring Configuration](#httpsession-jdbc-xml-spring-configuration) created a Spring bean named `springSessionRepositoryFilter` that implements `Filter`.
-The `springSessionRepositoryFilter` bean is responsible for replacing the `HttpSession` with a custom implementation that is backed by Spring Session.
-
-In order for our `Filter` to do its magic, we need to instruct Spring to load our `session.xml` configuration.
-We do so with the following configuration:
-
-src/main/webapp/WEB-INF/web.xml
-
-```
-
- contextConfigLocation
-
- /WEB-INF/spring/session.xml
-
-
-
-
- org.springframework.web.context.ContextLoaderListener
-
-
-```
-
-The [`ContextLoaderListener`](https://docs.spring.io/spring/docs/5.3.16/spring-framework-reference/core.html#context-create) reads the `contextConfigLocation` and picks up our session.xml configuration.
-
-Last, we need to ensure that our Servlet Container (that is, Tomcat) uses our `springSessionRepositoryFilter` for every request.
-The following snippet performs this last step for us:
-
-src/main/webapp/WEB-INF/web.xml
-
-```
-
- springSessionRepositoryFilter
- org.springframework.web.filter.DelegatingFilterProxy
-
-
- springSessionRepositoryFilter
- /*
- REQUEST
- ERROR
-
-```
-
-The [`DelegatingFilterProxy`](https://docs.spring.io/spring-framework/docs/5.3.16/javadoc-api/org/springframework/web/filter/DelegatingFilterProxy.html) looks up a bean named `springSessionRepositoryFilter` and casts it to a `Filter`.
-For every request on which `DelegatingFilterProxy` is invoked, the `springSessionRepositoryFilter` is invoked.
-
-### [](#httpsession-jdbc-boot)JDBC Spring Boot-based Configuration
-
-This section describes how to use a relational database to back `HttpSession` when you use Spring Boot.
-
-| |The [ HttpSession JDBC Spring Boot Sample](samples.html#samples) provides a working sample of how to integrate Spring Session and `HttpSession` by using Spring Boot. You can read the basic steps for integration in the next few sections, but we encourage you to follow along with the detailed HttpSession JDBC Spring Boot Guide when integrating with your own application.|
-|---|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-
-#### [](#httpsession-jdbc-boot-spring-configuration)Spring Boot Configuration
-
-After adding the required dependencies, we can create our Spring Boot configuration.
-Thanks to first-class auto configuration support, setting up Spring Session backed by a relational database is as simple as adding a single configuration property to your `application.properties`.
-The following listing shows how to do so:
-
-src/main/resources/application.properties
-
-```
-spring.session.store-type=jdbc # Session store type.
-```
-
-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 StoreType that you wish to use to store the sessions, as shows above.
-
-Under the hood, Spring Boot applies configuration that is equivalent to manually adding the `@EnableJdbcHttpSession` annotation.
-This creates a Spring bean with the name of `springSessionRepositoryFilter`. That bean implements `Filter`.
-The filter is in charge of replacing the `HttpSession` implementation to be backed by Spring Session.
-
-You can further customize by using `application.properties`.
-The following listing shows how to do so:
-
-src/main/resources/application.properties
-
-```
-server.servlet.session.timeout= # Session timeout. If a duration suffix is not specified, seconds are used.
-spring.session.jdbc.initialize-schema=embedded # Database schema initialization mode.
-spring.session.jdbc.schema=classpath:org/springframework/session/jdbc/[email protected]@[email protected]@.sql # Path to the SQL file to use to initialize the database schema.
-spring.session.jdbc.table-name=SPRING_SESSION # Name of the database table used to store sessions.
-```
-
-For more information, see the [Spring Session](https://docs.spring.io/spring-boot/docs/2.5.6/reference/htmlsingle/#boot-features-session) portion of the Spring Boot documentation.
-
-#### [](#httpsession-jdbc-boot-configuration)Configuring the `DataSource`
-
-Spring Boot automatically creates a `DataSource` that connects Spring Session to an embedded instance of an H2 database.
-In a production environment, you need to update your configuration to point to your relational database.
-For example, you can include the following in your application.properties:
-
-src/main/resources/application.properties
-
-```
-spring.datasource.url= # JDBC URL of the database.
-spring.datasource.username= # Login username of the database.
-spring.datasource.password= # Login password of the database.
-```
-
-For more information, see the [Configure a DataSource](https://docs.spring.io/spring-boot/docs/2.5.6/reference/htmlsingle/#boot-features-configure-datasource) portion of the Spring Boot documentation.
-
-#### [](#httpsession-jdbc-boot-servlet-configuration)Servlet Container Initialization
-
-Our [Spring Boot Configuration](#httpsession-jdbc-boot-spring-configuration) created a Spring bean named `springSessionRepositoryFilter` that implements `Filter`.
-The `springSessionRepositoryFilter` bean is responsible for replacing the `HttpSession` with a custom implementation that is backed by Spring Session.
-
-In order for our `Filter` to do its magic, Spring needs to load our `Config` class.
-Last, we need to ensure that our Servlet Container (that is, Tomcat) uses our `springSessionRepositoryFilter` for every request.
-Fortunately, Spring Boot takes care of both of these steps for us.
-
-## [](#httpsession-hazelcast)HttpSession with Hazelcast
-
-Using Spring Session with `HttpSession` is enabled by adding a Servlet Filter before anything that uses the `HttpSession`.
-
-This section describes how to use Hazelcast to back `HttpSession` by using Java-based configuration.
-
-| |The [ Hazelcast Spring Sample](samples.html#samples) provides a working sample of how to integrate Spring Session and `HttpSession` by using Java configuration. You can read the basic steps for integration in the next few sections, but we encourage you to follow along with the detailed Hazelcast Spring Guide when integrating with your own application.|
-|---|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-
-### [](#security-spring-configuration)Spring Configuration
-
-After adding the required dependencies, we can create our Spring configuration.
-The Spring configuration is responsible for creating a servlet filter that replaces the `HttpSession` implementation with an implementation backed by Spring Session.
-To do so, add the following Spring Configuration:
-
-```
-@EnableHazelcastHttpSession (1)
-@Configuration
-public class HazelcastHttpSessionConfig {
-
- @Bean
- public HazelcastInstance hazelcastInstance() {
- Config config = new Config();
- MapAttributeConfig attributeConfig = new MapAttributeConfig()
- .setName(HazelcastIndexedSessionRepository.PRINCIPAL_NAME_ATTRIBUTE)
- .setExtractor(PrincipalNameExtractor.class.getName());
- config.getMapConfig(HazelcastIndexedSessionRepository.DEFAULT_SESSION_MAP_NAME) (2)
- .addMapAttributeConfig(attributeConfig).addMapIndexConfig(
- new MapIndexConfig(HazelcastIndexedSessionRepository.PRINCIPAL_NAME_ATTRIBUTE, false));
- SerializerConfig serializerConfig = new SerializerConfig();
- serializerConfig.setImplementation(new HazelcastSessionSerializer()).setTypeClass(MapSession.class);
- config.getSerializationConfig().addSerializerConfig(serializerConfig); (3)
- return Hazelcast.newHazelcastInstance(config); (4)
- }
-
-}
-```
-
-|**1**| The `@EnableHazelcastHttpSession` annotation creates a Spring bean named `springSessionRepositoryFilter` that implements `Filter`. The filter is in charge of replacing the `HttpSession` implementation to be backed by Spring Session. In this instance, Spring Session is backed by Hazelcast. |
-|-----|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-|**2**| In order to support retrieval of sessions by principal name index, an appropriate `ValueExtractor` needs to be registered. Spring Session provides `PrincipalNameExtractor` for this purpose. |
-|**3**| In order to serialize `MapSession` objects efficiently, `HazelcastSessionSerializer` needs to be registered. If this is not set, Hazelcast will serialize sessions using native Java serialization. |
-|**4**|We create a `HazelcastInstance` that connects Spring Session to Hazelcast. By default, the application starts and connects to an embedded instance of Hazelcast. For more information on configuring Hazelcast, see the [reference documentation](https://docs.hazelcast.org/docs/3.12.12/manual/html-single/index.html#hazelcast-configuration).|
-
-| |If `HazelcastSessionSerializer` is preferred, it needs to be configured for all Hazelcast cluster members before they start. In a Hazelcast cluster, all members should use the same serialization method for sessions. Also, if Hazelcast Client/Server topology is used, then both members and clients must use the same serialization method. The serializer can be registered via `ClientConfig`with the same `SerializerConfiguration` of members.|
-|---|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-
-### [](#_servlet_container_initialization)Servlet Container Initialization
-
-Our [Spring Configuration](guides/java-security.html#security-spring-configuration) created a Spring bean named `springSessionRepositoryFilter` that implements `Filter`.
-The `springSessionRepositoryFilter` bean is responsible for replacing the `HttpSession` with a custom implementation that is backed by Spring Session.
-
-In order for our `Filter` to do its magic, Spring needs to load our `SessionConfig` class.
-Since our application is already loading Spring configuration by using our `SecurityInitializer` class, we can add our `SessionConfig` class to it.
-The following listing shows how to do so:
-
-src/main/java/sample/SecurityInitializer.java
-
-```
-public class SecurityInitializer extends AbstractSecurityWebApplicationInitializer {
-
- public SecurityInitializer() {
- super(SecurityConfig.class, SessionConfig.class);
- }
-
-}
-```
-
-Last, we need to ensure that our Servlet Container (that is, Tomcat) uses our `springSessionRepositoryFilter` for every request.
-It is extremely important that Spring Session’s `springSessionRepositoryFilter` is invoked before Spring Security’s `springSecurityFilterChain`.
-Doing so ensures that the `HttpSession` that Spring Security uses is backed by Spring Session.
-Fortunately, Spring Session provides a utility class named `AbstractHttpSessionApplicationInitializer` that makes this doing so easy.
-The following example shows how to do so:
-
-src/main/java/sample/Initializer.java
-
-```
-public class Initializer extends AbstractHttpSessionApplicationInitializer {
-
-}
-```
-
-| |The name of our class (`Initializer`) does not matter. What is important is that we extend `AbstractHttpSessionApplicationInitializer`.|
-|---|---------------------------------------------------------------------------------------------------------------------------------------|
-
-By extending `AbstractHttpSessionApplicationInitializer`, we ensure that the Spring Bean named `springSessionRepositoryFilter` is registered with our servlet container for every request before Spring Security’s `springSecurityFilterChain`.
-
-## [](#httpsession-how)How `HttpSession` Integration Works
-
-Fortunately, both `HttpSession` and `HttpServletRequest` (the API for obtaining an `HttpSession`) are both interfaces.
-This means that we can provide our own implementations for each of these APIs.
-
-| |This section describes how Spring Session provides transparent integration with `HttpSession`. We offer this content so that you can understand what is happening under the covers. This functionality is already integrated and you do NOT need to implement this logic yourself.|
-|---|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-
-First, we create a custom `HttpServletRequest` that returns a custom implementation of `HttpSession`.
-It looks something like the following:
-
-```
-public class SessionRepositoryRequestWrapper extends HttpServletRequestWrapper {
-
- public SessionRepositoryRequestWrapper(HttpServletRequest original) {
- super(original);
- }
-
- public HttpSession getSession() {
- return getSession(true);
- }
-
- public HttpSession getSession(boolean createNew) {
- // create an HttpSession implementation from Spring Session
- }
-
- // ... other methods delegate to the original HttpServletRequest ...
-}
-```
-
-Any method that returns an `HttpSession` is overridden.
-All other methods are implemented by `HttpServletRequestWrapper` and delegate to the original `HttpServletRequest` implementation.
-
-We replace the `HttpServletRequest` implementation by using a servlet `Filter` called `SessionRepositoryFilter`.
-The following pseudocode shows how it works:
-
-```
-public class SessionRepositoryFilter implements Filter {
-
- public doFilter(ServletRequest request, ServletResponse response, FilterChain chain) {
- HttpServletRequest httpRequest = (HttpServletRequest) request;
- SessionRepositoryRequestWrapper customRequest =
- new SessionRepositoryRequestWrapper(httpRequest);
-
- chain.doFilter(customRequest, response, chain);
- }
-
- // ...
-}
-```
-
-By passing a custom `HttpServletRequest` implementation into the `FilterChain`, we ensure that anything invoked after our `Filter` uses the custom `HttpSession` implementation.
-This highlights why it is important that Spring Session’s `SessionRepositoryFilter` be placed before anything that interacts with the `HttpSession`.
-
-## [](#httpsession-rest)`HttpSession` and RESTful APIs
-
-Spring Session can work with RESTful APIs by letting the session be provided in a header.
-
-| |The [ REST Sample](samples.html#samples) provides a working sample of how to use Spring Session in a REST application to support authenticating with a header. You can follow the basic steps for integration described in the next few sections, but we encourage you to follow along with the detailed REST Guide when integrating with your own application.|
-|---|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-
-### [](#rest-spring-configuration)Spring Configuration
-
-After adding the required dependencies, we can create our Spring configuration.
-The Spring configuration is responsible for creating a servlet filter that replaces the `HttpSession` implementation with an implementation backed by Spring Session.
-To do so, add the following Spring Configuration:
-
-```
-@Configuration
-@EnableRedisHttpSession (1)
-public class HttpSessionConfig {
-
- @Bean
- public LettuceConnectionFactory connectionFactory() {
- return new LettuceConnectionFactory(); (2)
- }
-
- @Bean
- public HttpSessionIdResolver httpSessionIdResolver() {
- return HeaderHttpSessionIdResolver.xAuthToken(); (3)
- }
-
-}
-```
-
-|**1**| The `@EnableRedisHttpSession` annotation creates a Spring bean named `springSessionRepositoryFilter` that implements `Filter`. The filter is in charge of replacing the `HttpSession` implementation to be backed by Spring Session. In this instance, Spring Session is backed by Redis. |
-|-----|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-|**2**|We create a `RedisConnectionFactory` that connects Spring Session to the Redis Server. We configure the connection to connect to localhost on the default port (6379). For more information on configuring Spring Data Redis, see the [reference documentation](https://docs.spring.io/spring-data/data-redis/docs/2.6.2/reference/html/).|
-|**3**| We customize Spring Session’s HttpSession integration to use HTTP headers to convey the current session information instead of cookies. |
-
-### [](#_servlet_container_initialization_2)Servlet Container Initialization
-
-Our [Spring Configuration](#rest-spring-configuration) created a Spring Bean named `springSessionRepositoryFilter` that implements `Filter`.
-The `springSessionRepositoryFilter` bean is responsible for replacing the `HttpSession` with a custom implementation that is backed by Spring Session.
-
-In order for our `Filter` to do its magic, Spring needs to load our `Config` class.
-We provide the configuration in our Spring `MvcInitializer`, as the following example shows:
-
-src/main/java/sample/mvc/MvcInitializer.java
-
-```
-@Override
-protected Class>[] getRootConfigClasses() {
- return new Class[] { SecurityConfig.class, HttpSessionConfig.class };
-}
-```
-
-Last, we need to ensure that our Servlet Container (that is, Tomcat) uses our `springSessionRepositoryFilter` for every request.
-Fortunately, Spring Session provides a utility class named `AbstractHttpSessionApplicationInitializer` that makes doing so easy. To do so, extend the class with the default constructor, as the following example shows:
-
-src/main/java/sample/Initializer.java
-
-```
-public class Initializer extends AbstractHttpSessionApplicationInitializer {
-
-}
-```
-
-| |The name of our class (`Initializer`) does not matter. What is important is that we extend `AbstractHttpSessionApplicationInitializer`.|
-|---|---------------------------------------------------------------------------------------------------------------------------------------|
-
-## [](#httpsession-httpsessionlistener)Using `HttpSessionListener`
-
-Spring Session supports `HttpSessionListener` by translating `SessionDestroyedEvent` and `SessionCreatedEvent` into `HttpSessionEvent` by declaring `SessionEventHttpSessionListenerAdapter`.
-To use this support, you need to:
-
-* Ensure your `SessionRepository` implementation supports and is configured to fire `SessionDestroyedEvent` and `SessionCreatedEvent`.
-
-* Configure `SessionEventHttpSessionListenerAdapter` as a Spring bean.
-
-* Inject every `HttpSessionListener` into the `SessionEventHttpSessionListenerAdapter`
-
-If you use the configuration support documented in [`HttpSession` with Redis](#httpsession-redis), all you need to do is register every `HttpSessionListener` as a bean.
-For example, assume you want to support Spring Security’s concurrency control and need to use `HttpSessionEventPublisher`. In that case, you can add `HttpSessionEventPublisher` as a bean.
-In Java configuration, this might look like the following:
-
-```
-@Configuration
-@EnableRedisHttpSession
-public class RedisHttpSessionConfig {
-
- @Bean
- public HttpSessionEventPublisher httpSessionEventPublisher() {
- return new HttpSessionEventPublisher();
- }
-
- // ...
-
-}
-```
-
-In XML configuration, this might look like the following:
-
-```
-
-```
\ No newline at end of file
diff --git a/docs/spring-session/en/index.md b/docs/spring-session/en/index.md
deleted file mode 100644
index 2d857d71df5823a4ebe9d7701d40e01a33847c96..0000000000000000000000000000000000000000
--- a/docs/spring-session/en/index.md
+++ /dev/null
@@ -1,61 +0,0 @@
-# Spring Session
-
-Spring Session provides an API and implementations for managing a user’s session information.
-
-Spring Session provides an API and implementations for managing a user’s session information while also making it trivial to support clustered sessions without being tied to an application container-specific solution.
-It also provides transparent integration with:
-
-* [HttpSession](http-session.html#httpsession): Allows replacing the `HttpSession` in an application container-neutral way, with support for providing session IDs in headers to work with RESTful APIs.
-
-* [WebSocket](web-socket.html#websocket): Provides the ability to keep the `HttpSession` alive when receiving WebSocket messages
-
-* [WebSession](web-session.html#websession): Allows replacing the Spring WebFlux’s `WebSession` in an application container-neutral way.
-
-## [](#community)Spring Session Community
-
-We are glad to consider you a part of our community.
-The following sections provide additional about how to interact with the Spring Session community.
-
-### [](#community-support)Support
-
-You can get help by asking questions on [Stack Overflow with the `spring-session` tag](https://stackoverflow.com/questions/tagged/spring-session).
-Similarly, we encourage helping others by answering questions on Stack Overflow.
-
-### [](#community-source)Source Code
-
-You can find the source code on GitHub at [https://github.com/spring-projects/spring-session/](https://github.com/spring-projects/spring-session/)
-
-### [](#community-issues)Issue Tracking
-
-We track issues in GitHub issues at [https://github.com/spring-projects/spring-session/issues](https://github.com/spring-projects/spring-session/issues)
-
-### [](#community-contributing)Contributing
-
-We appreciate [pull requests](https://help.github.com/articles/using-pull-requests/).
-
-### [](#community-license)License
-
-Spring Session is Open Source software released under the [Apache 2.0 license](https://www.apache.org/licenses/LICENSE-2.0).
-
-### [](#community-extensions)Community Extensions
-
-| Name | Location |
-|-------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-|Spring Session Infinispan|[https://infinispan.org/infinispan-spring-boot/master/spring\_boot\_starter.html#\_enabling\_spring\_session\_support](https://infinispan.org/infinispan-spring-boot/master/spring_boot_starter.html#_enabling_spring_session_support)|
-
-## [](#minimum-requirements)Minimum Requirements
-
-The minimum requirements for Spring Session are:
-
-* Java 8+.
-
-* If you run in a Servlet Container (not required), Servlet 3.1+.
-
-* If you use other Spring libraries (not required), the minimum required version is Spring 5.0.x.
-
-* `@EnableRedisHttpSession` requires Redis 2.8+. This is necessary to support [Session Expiration](api.html#api-redisindexedsessionrepository-expiration)
-
-* `@EnableHazelcastHttpSession` requires Hazelcast 3.6+. This is necessary to support [`FindByIndexNameSessionRepository`](api.html#api-enablehazelcasthttpsession-storage)
-
-| |At its core, Spring Session has a required dependency only on `spring-jcl`. For an example of using Spring Session without any other Spring dependencies, see the [hazelcast sample](samples.html#samples) application.|
-|---|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
\ No newline at end of file
diff --git a/docs/spring-session/en/modules.md b/docs/spring-session/en/modules.md
deleted file mode 100644
index 194ec7046b610fbd33ca078c27078336a637622f..0000000000000000000000000000000000000000
--- a/docs/spring-session/en/modules.md
+++ /dev/null
@@ -1,24 +0,0 @@
-# Spring Session Modules
-
-In Spring Session 1.x, all of the Spring Session’s `SessionRepository` implementations were available within the `spring-session` artifact.
-While convenient, this approach was not sustainable long-term as more features and `SessionRepository` implementations were added to the project.
-
-With Spring Session 2.0, several modules were split off to be separate modules as well as managed repositories.
-Spring Session for MongoDB was retired, but was later reactivated as a separate module.
-As of Spring Session 2.6, Spring Session for MongoDB was merged back into Spring Session.
-
-Now the situation with the various repositories and modules is as follows:
-
-* [`spring-session` repository](https://github.com/spring-projects/spring-session)
-
- * Hosts the Spring Session Core, Spring Session for MongoDB, Spring Session for Redis, Spring Session JDBC, and Spring Session Hazelcast modules.
-
-* [`spring-session-data-geode` repository](https://github.com/spring-projects/spring-session-data-geode)
-
- * Hosts the Spring Session Data Geode modules. Spring Session Data Geode has its own user guide, which you can find at the [[https://spring.io/projects/spring-session-data-geode#learn](https://spring.io/projects/spring-session-data-geode#learn) site].
-
-Finally, Spring Session also provides a Maven BOM (“bill of materials”) module in order to help users with version management concerns:
-
-* [`spring-session-bom` repository](https://github.com/spring-projects/spring-session-bom)
-
- * Hosts the Spring Session BOM module
\ No newline at end of file
diff --git a/docs/spring-session/en/samples.md b/docs/spring-session/en/samples.md
deleted file mode 100644
index 4a89f540ff3789427050ec5c96c3b3524117b5f8..0000000000000000000000000000000000000000
--- a/docs/spring-session/en/samples.md
+++ /dev/null
@@ -1,35 +0,0 @@
-# Samples and Guides (Start Here)
-
-To get started with Spring Session, the best place to start is our Sample Applications.
-
-| Source | Description | Guide |
-|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------|
-| [HttpSession with Redis](https://github.com/spring-projects/spring-session/tree/main/spring-session-samples/spring-session-sample-boot-redis) | Demonstrates how to use Spring Session to replace the `HttpSession` with Redis. | [HttpSession with Redis Guide](guides/boot-redis.html) |
-| [HttpSession with JDBC](https://github.com/spring-projects/spring-session/tree/main/spring-session-samples/spring-session-sample-boot-jdbc) | Demonstrates how to use Spring Session to replace the `HttpSession` with a relational database store. | [HttpSession with JDBC Guide](guides/boot-jdbc.html) |
-| [HttpSession with Hazelcast](https://github.com/spring-projects/spring-session/tree/main/spring-session-samples/spring-session-sample-boot-hazelcast) | Demonstrates how to use Spring Session to replace the `HttpSession` with Hazelcast. | |
-| [Find by Username](https://github.com/spring-projects/spring-session/tree/main/spring-session-samples/spring-session-sample-boot-findbyusername) | Demonstrates how to use Spring Session to find sessions by username. | [Find by Username Guide](guides/boot-findbyusername.html) |
-| [WebSockets](https://github.com/spring-projects/spring-session/tree/main/spring-session-samples/spring-session-sample-boot-websocket) | Demonstrates how to use Spring Session with WebSockets. | [WebSockets Guide](guides/boot-websocket.html) |
-| [WebFlux](https://github.com/spring-projects/spring-session/tree/main/spring-session-samples/spring-session-sample-boot-webflux) | Demonstrates how to use Spring Session to replace the Spring WebFlux’s `WebSession` with Redis. | |
-| [WebFlux with Custom Cookie](https://github.com/spring-projects/spring-session/tree/main/spring-session-samples/spring-session-sample-boot-webflux-custom-cookie) | Demonstrates how to use Spring Session to customize the Session cookie in a WebFlux based application. |[WebFlux with Custom Cookie Guide](guides/boot-webflux-custom-cookie.html)|
-| [HttpSession with Redis JSON serialization](https://github.com/spring-projects/spring-session/tree/main/spring-session-samples/spring-session-sample-boot-redis-json) | Demonstrates how to use Spring Session to replace the `HttpSession` with Redis using JSON serialization. | |
-| [HttpSession with simple Redis `SessionRepository`](https://github.com/spring-projects/spring-session/tree/main/spring-session-samples/spring-session-sample-boot-redis-simple) |Demonstrates how to use Spring Session to replace the `HttpSession` with Redis using `RedisSessionRepository`.| |
-|[Spring Session with MongoDB Repositories (servlet-based)](https://github.com/spring-projects/spring-session/tree/main/spring-session-samples/spring-session-sample-boot-mongodb-traditional)| Demonstrates how to back Spring Session with traditional MongoDB repositories. | [Spring Session with MongoDB Repositories](guides/boot-mongo.html) |
-| [Spring Session with MongoDB Repositories (reactive)](https://github.com/spring-projects/spring-session/tree/main/spring-session-samples/spring-session-sample-boot-mongodb-reactive) | Demonstrates how to back Spring Session with reactive MongoDB repositories. | [Spring Session with MongoDB Repositories](guides/boot-mongo.html) |
-
-| Source | Description | Guide |
-|-----------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------|--------------------------------------------------------------|
-| [HttpSession with Redis](https://github.com/spring-projects/spring-session/tree/main/spring-session-samples/spring-session-sample-javaconfig-redis) | Demonstrates how to use Spring Session to replace the `HttpSession` with Redis. | [HttpSession with Redis Guide](guides/java-redis.html) |
-| [HttpSession with JDBC](https://github.com/spring-projects/spring-session/tree/main/spring-session-samples/spring-session-sample-javaconfig-jdbc) |Demonstrates how to use Spring Session to replace the `HttpSession` with a relational database store.| [HttpSession with JDBC Guide](guides/java-jdbc.html) |
-|[HttpSession with Hazelcast](https://github.com/spring-projects/spring-session/tree/main/spring-session-samples/spring-session-sample-javaconfig-hazelcast)| Demonstrates how to use Spring Session to replace the `HttpSession` with Hazelcast. |[HttpSession with Hazelcast Guide](guides/java-hazelcast.html)|
-| [Custom Cookie](https://github.com/spring-projects/spring-session/tree/main/spring-session-samples/spring-session-sample-javaconfig-custom-cookie) | Demonstrates how to use Spring Session and customize the cookie. | [Custom Cookie Guide](guides/java-custom-cookie.html) |
-| [Spring Security](https://github.com/spring-projects/spring-session/tree/main/spring-session-samples/spring-session-sample-javaconfig-security) | Demonstrates how to use Spring Session with an existing Spring Security application. | [Spring Security Guide](guides/java-security.html) |
-| [REST](https://github.com/spring-projects/spring-session/tree/main/spring-session-samples/spring-session-sample-javaconfig-rest) |Demonstrates how to use Spring Session in a REST application to support authenticating with a header.| [REST Guide](guides/java-rest.html) |
-
-| Source | Description | Guide |
-|--------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------|-----------------------------------------------------|
-|[HttpSession with Redis](https://github.com/spring-projects/spring-session/tree/main/spring-session-samples/spring-session-sample-xml-redis)| Demonstrates how to use Spring Session to replace the `HttpSession` with a Redis store. |[HttpSession with Redis Guide](guides/xml-redis.html)|
-| [HttpSession with JDBC](https://github.com/spring-projects/spring-session/tree/main/spring-session-samples/spring-session-sample-xml-jdbc) |Demonstrates how to use Spring Session to replace the `HttpSession` with a relational database store.| [HttpSession with JDBC Guide](guides/xml-jdbc.html) |
-
-| Source | Description |Guide|
-|------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------|-----|
-|[Hazelcast](https://github.com/spring-projects/spring-session/tree/main/spring-session-samples/spring-session-sample-misc-hazelcast)|Demonstrates how to use Spring Session with Hazelcast in a Java EE application.| |
\ No newline at end of file
diff --git a/docs/spring-session/en/spring-security.md b/docs/spring-session/en/spring-security.md
deleted file mode 100644
index ed8b4233ee9c6ec13189152de6a0730932b7ff3b..0000000000000000000000000000000000000000
--- a/docs/spring-session/en/spring-security.md
+++ /dev/null
@@ -1,112 +0,0 @@
-# Spring Security Integration
-
-Spring Session provides integration with Spring Security.
-
-## [](#spring-security-rememberme)Spring Security Remember-me Support
-
-Spring Session provides integration with [Spring Security’s Remember-me Authentication](https://docs.spring.io/spring-security/site/docs/5.6.2/reference/html5/#servlet-rememberme).
-The support:
-
-* Changes the session expiration length
-
-* Ensures that the session cookie expires at `Integer.MAX_VALUE`.
- The cookie expiration is set to the largest possible value, because the cookie is set only when the session is created.
- If it were set to the same value as the session expiration, the session would get renewed when the user used it but the cookie expiration would not be updated (causing the expiration to be fixed).
-
-To configure Spring Session with Spring Security in Java Configuration, you can use the following listing as a guide:
-
-```
-@Override
-protected void configure(HttpSecurity http) throws Exception {
- http
- // ... additional configuration ...
- .rememberMe((rememberMe) -> rememberMe
- .rememberMeServices(rememberMeServices())
- );
-}
-
-@Bean
-public SpringSessionRememberMeServices rememberMeServices() {
- SpringSessionRememberMeServices rememberMeServices =
- new SpringSessionRememberMeServices();
- // optionally customize
- rememberMeServices.setAlwaysRemember(true);
- return rememberMeServices;
-}
-```
-
-An XML-based configuration would look something like the following:
-
-```
-
-
-
-
-
-
-
-```
-
-## [](#spring-security-concurrent-sessions)Spring Security Concurrent Session Control
-
-Spring Session provides integration with Spring Security to support its concurrent session control.
-This allows limiting the number of active sessions that a single user can have concurrently, but, unlike the default
-Spring Security support, this also works in a clustered environment. This is done by providing a custom
-implementation of Spring Security’s `SessionRegistry` interface.
-
-When using Spring Security’s Java config DSL, you can configure the custom `SessionRegistry` through the`SessionManagementConfigurer`, as the following listing shows:
-
-```
-@Configuration
-public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
-
- @Autowired
- private FindByIndexNameSessionRepository sessionRepository;
-
- @Override
- protected void configure(HttpSecurity http) throws Exception {
- // @formatter:off
- http
- // other config goes here...
- .sessionManagement((sessionManagement) -> sessionManagement
- .maximumSessions(2)
- .sessionRegistry(sessionRegistry())
- );
- // @formatter:on
- }
-
- @Bean
- public SpringSessionBackedSessionRegistry sessionRegistry() {
- return new SpringSessionBackedSessionRegistry<>(this.sessionRepository);
- }
-
-}
-```
-
-This assumes that you have also configured Spring Session to provide a `FindByIndexNameSessionRepository` that
-returns `Session` instances.
-
-When using XML configuration, it would look something like the following listing:
-
-```
-
-
-
-
-
-
-
-
-
-
-```
-
-This assumes that your Spring Session `SessionRegistry` bean is called `sessionRegistry`, which is the name used by all`SpringHttpSessionConfiguration` subclasses.
-
-## [](#spring-security-concurrent-sessions-limitations)Limitations
-
-Spring Session’s implementation of Spring Security’s `SessionRegistry` interface does not support the `getAllPrincipals`method, as this information cannot be retrieved by using Spring Session. This method is never called by Spring Security,
-so this affects only applications that access the `SessionRegistry` themselves.
\ No newline at end of file
diff --git a/docs/spring-session/en/upgrading.md b/docs/spring-session/en/upgrading.md
deleted file mode 100644
index 412c25473f843091213590435e47e0f1bff6d1db..0000000000000000000000000000000000000000
--- a/docs/spring-session/en/upgrading.md
+++ /dev/null
@@ -1,57 +0,0 @@
-# Upgrading to 2.x
-
-With the new major release version, the Spring Session team took the opportunity to make some non-passive changes.
-The focus of these changes is to improve and harmonize Spring Session’s APIs as well as remove the deprecated components.
-
-## [](#_baseline_update)Baseline Update
-
-Spring Session 2.0 requires Java 8 and Spring Framework 5.0 as a baseline, since its entire codebase is now based on Java 8 source code.
-See [Upgrading to Spring Framework 5.x](https://github.com/spring-projects/spring-framework/wiki/Upgrading-to-Spring-Framework-5.x) for more on upgrading Spring Framework.
-
-## [](#_replaced_and_removed_modules)Replaced and Removed Modules
-
-As a part of the project’s splitting of the modules, the existing `spring-session` has been replaced with the `spring-session-core` module.
-The `spring-session-core` module holds only the common set of APIs and components, while other modules contain the implementation of the appropriate `SessionRepository` and functionality related to that data store.
-This applies to several existing modules that were previously a simple dependency aggregator helper module.
-With new module arrangement, the following modules actually carry the implementation:
-
-* Spring Session for MongoDB
-
-* Spring Session for Redis
-
-* Spring Session JDBC
-
-* Spring Session Hazelcast
-
-Also, the following were removed from the main project repository:
-
-* Spring Session Data GemFire
-
- * [`spring-session-data-geode`](https://github.com/spring-projects/spring-session-data-geode)
-
-## [](#_replaced_and_removed_packages_classes_and_methods)Replaced and Removed Packages, Classes, and Methods
-
-The following changes were made to packages, classes, and methods:
-
-* `ExpiringSession` API has been merged into the `Session` API.
-
-* The `Session` API has been enhanced to make full use of Java 8.
-
-* The `Session` API has been extended with `changeSessionId` support.
-
-* The `SessionRepository` API has been updated to better align with Spring Data method naming conventions.
-
-* `AbstractSessionEvent` and its subclasses are no longer constructable without an underlying `Session` object.
-
-* The Redis namespace used by `RedisOperationsSessionRepository` is now fully configurable, instead of being partially configurable.
-
-* Redis configuration support has been updated to avoid registering a Spring Session-specific `RedisTemplate` bean.
-
-* JDBC configuration support has been updated to avoid registering a Spring Session-specific `JdbcTemplate` bean.
-
-* Previously deprecated classes and methods have been removed across the codebase
-
-## [](#_dropped_support)Dropped Support
-
-As a part of the changes to `HttpSessionStrategy` and its alignment to the counterpart from the reactive world, the support for managing multiple users' sessions in a single browser instance has been removed.
-The introduction of a new API to replace this functionality is under consideration for future releases.
\ No newline at end of file
diff --git a/docs/spring-session/en/web-session.md b/docs/spring-session/en/web-session.md
deleted file mode 100644
index bf099390d35b99cea37dafb6810b6ec287711a8e..0000000000000000000000000000000000000000
--- a/docs/spring-session/en/web-session.md
+++ /dev/null
@@ -1,100 +0,0 @@
-# WebSession Integration
-
-Spring Session provides transparent integration with Spring WebFlux’s `WebSession`.
-This means that you can switch the `WebSession` implementation out with an implementation that is backed by Spring Session.
-
-## [](#websession-why)Why Spring Session and WebSession?
-
-We have already mentioned that Spring Session provides transparent integration with Spring WebFlux’s `WebSession`, but what benefits do we get out of this?
-As with `HttpSession`, Spring Session makes it trivial to support [clustered sessions](#websession-redis) without being tied to an application container specific solution.
-
-## [](#websession-redis)WebSession with Redis
-
-Using Spring Session with `WebSession` is enabled by registering a `WebSessionManager` implementation backed by Spring Session’s `ReactiveSessionRepository`.
-The Spring configuration is responsible for creating a `WebSessionManager` that replaces the `WebSession` implementation with an implementation backed by Spring Session.
-To do so, add the following Spring Configuration:
-
-```
-@EnableRedisWebSession (1)
-public class SessionConfiguration {
-
- @Bean
- public LettuceConnectionFactory redisConnectionFactory() {
- return new LettuceConnectionFactory(); (2)
- }
-
-}
-```
-
-|**1**| The `@EnableRedisWebSession` annotation creates a Spring bean with the name of `webSessionManager`. That bean implements the `WebSessionManager`. This is what is in charge of replacing the `WebSession` implementation to be backed by Spring Session. In this instance, Spring Session is backed by Redis. |
-|-----|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-|**2**|We create a `RedisConnectionFactory` that connects Spring Session to the Redis Server. We configure the connection to connect to localhost on the default port (6379) For more information on configuring Spring Data Redis, see the [reference documentation](https://docs.spring.io/spring-data/data-redis/docs/2.6.2/reference/html/).|
-
-## [](#websession-how)How WebSession Integration Works
-
-It is considerably easier for Spring Session to integrate with Spring WebFlux and its `WebSession`, compared to Servlet API and its `HttpSession`.
-Spring WebFlux provides the `WebSessionStore` API, which presents a strategy for persisting `WebSession`.
-
-| |This section describes how Spring Session provides transparent integration with `WebSession`. We offer this content so that you can understand what is happening under the covers. This functionality is already integrated and you do NOT need to implement this logic yourself.|
-|---|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-
-First, we create a custom `SpringSessionWebSession` that delegates to Spring Session’s `Session`.
-It looks something like the following:
-
-```
-public class SpringSessionWebSession implements WebSession {
-
- enum State {
- NEW, STARTED
- }
-
- private final S session;
-
- private AtomicReference state = new AtomicReference<>();
-
- SpringSessionWebSession(S session, State state) {
- this.session = session;
- this.state.set(state);
- }
-
- @Override
- public void start() {
- this.state.compareAndSet(State.NEW, State.STARTED);
- }
-
- @Override
- public boolean isStarted() {
- State value = this.state.get();
- return (State.STARTED.equals(value)
- || (State.NEW.equals(value) && !this.session.getAttributes().isEmpty()));
- }
-
- @Override
- public Mono changeSessionId() {
- return Mono.defer(() -> {
- this.session.changeSessionId();
- return save();
- });
- }
-
- // ... other methods delegate to the original Session
-}
-```
-
-Next, we create a custom `WebSessionStore` that delegates to the `ReactiveSessionRepository` and wraps `Session` into custom `WebSession` implementation, as the following listing shows:
-
-```
-public class SpringSessionWebSessionStore implements WebSessionStore {
-
- private final ReactiveSessionRepository sessions;
-
- public SpringSessionWebSessionStore(ReactiveSessionRepository reactiveSessionRepository) {
- this.sessions = reactiveSessionRepository;
- }
-
- // ...
-}
-```
-
-To be detected by Spring WebFlux, this custom `WebSessionStore` needs to be registered with `ApplicationContext` as a bean named `webSessionManager`.
-For additional information on Spring WebFlux, see the [Spring Framework Reference Documentation](https://docs.spring.io/spring-framework/docs/5.3.16/reference/html/web-reactive.html).
\ No newline at end of file
diff --git a/docs/spring-session/en/web-socket.md b/docs/spring-session/en/web-socket.md
deleted file mode 100644
index fcba509d8ad93ec7fda79df13f37c7f653c80162..0000000000000000000000000000000000000000
--- a/docs/spring-session/en/web-socket.md
+++ /dev/null
@@ -1,99 +0,0 @@
-# WebSocket Integration
-
-Spring Session provides transparent integration with Spring’s WebSocket support.
-
-| |Spring Session’s WebSocket support works only with Spring’s WebSocket support. Specifically,it does not work with using [JSR-356](https://www.jcp.org/en/jsr/detail?id=356) directly, because JSR-356 does not have a mechanism for intercepting incoming WebSocket messages.|
-|---|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-
-## [](#websocket-why)Why Spring Session and WebSockets?
-
-So why do we need Spring Session when we use WebSockets?
-
-Consider an email application that does much of its work through HTTP requests.
-However, there is also a chat application embedded within it that works over WebSocket APIs.
-If a user is actively chatting with someone, we should not timeout the `HttpSession`, since this would be a pretty poor user experience.
-However, this is exactly what [JSR-356](https://java.net/jira/browse/WEBSOCKET_SPEC-175) does.
-
-Another issue is that, according to JSR-356, if the `HttpSession` times out, any WebSocket that was created with that `HttpSession` and an authenticated user should be forcibly closed.
-This means that, if we are actively chatting in our application and are not using the HttpSession, we also do disconnect from our conversation.
-
-## [](#websocket-usage)WebSocket Usage
-
-The [ WebSocket Sample](samples.html#samples) provides a working sample of how to integrate Spring Session with WebSockets.
-You can follow the basic steps for integration described in the next few headings, but we encourage you to follow along with the detailed WebSocket Guide when integrating with your own application.
-
-### [](#websocket-httpsession)`HttpSession` Integration
-
-Before using WebSocket integration, you should be sure that you have [`HttpSession` Integration](http-session.html#httpsession) working first.
-
-#### [](#websocket-spring-configuration)Spring Configuration
-
-In a typical Spring WebSocket application, you would implement `WebSocketMessageBrokerConfigurer`.
-For example, the configuration might look something like the following:
-
-```
-@Configuration
-@EnableScheduling
-@EnableWebSocketMessageBroker
-public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
-
- @Override
- public void registerStompEndpoints(StompEndpointRegistry registry) {
- registry.addEndpoint("/messages").withSockJS();
- }
-
- @Override
- public void configureMessageBroker(MessageBrokerRegistry registry) {
- registry.enableSimpleBroker("/queue/", "/topic/");
- registry.setApplicationDestinationPrefixes("/app");
- }
-
-}
-```
-
-We can update our configuration to use Spring Session’s WebSocket support.
-The following example shows how to do so:
-
-src/main/java/samples/config/WebSocketConfig.java
-
-```
-@Configuration
-@EnableScheduling
-@EnableWebSocketMessageBroker
-public class WebSocketConfig extends AbstractSessionWebSocketMessageBrokerConfigurer { (1)
-
- @Override
- protected void configureStompEndpoints(StompEndpointRegistry registry) { (2)
- registry.addEndpoint("/messages").withSockJS();
- }
-
- @Override
- public void configureMessageBroker(MessageBrokerRegistry registry) {
- registry.enableSimpleBroker("/queue/", "/topic/");
- registry.setApplicationDestinationPrefixes("/app");
- }
-
-}
-```
-
-To hook in the Spring Session support we only need to change two things:
-
-|**1**|Instead of implementing `WebSocketMessageBrokerConfigurer`, we extend `AbstractSessionWebSocketMessageBrokerConfigurer`|
-|-----|-----------------------------------------------------------------------------------------------------------------------|
-|**2**| We rename the `registerStompEndpoints` method to `configureStompEndpoints` |
-
-What does `AbstractSessionWebSocketMessageBrokerConfigurer` do behind the scenes?
-
-* `WebSocketConnectHandlerDecoratorFactory` is added as a `WebSocketHandlerDecoratorFactory` to `WebSocketTransportRegistration`.
- This ensures a custom `SessionConnectEvent` is fired that contains the `WebSocketSession`.
- The `WebSocketSession` is necessary to end any WebSocket connections that are still open when a Spring Session is ended.
-
-* `SessionRepositoryMessageInterceptor` is added as a `HandshakeInterceptor` to every `StompWebSocketEndpointRegistration`.
- This ensures that the `Session` is added to the WebSocket properties to enable updating the last accessed time.
-
-* `SessionRepositoryMessageInterceptor` is added as a `ChannelInterceptor` to our inbound `ChannelRegistration`.
- This ensures that every time an inbound message is received, that the last accessed time of our Spring Session is updated.
-
-* `WebSocketRegistryListener` is created as a Spring bean.
- This ensures that we have a mapping of all of the `Session` IDs to the corresponding WebSocket connections.
- By maintaining this mapping, we can close all the WebSocket connections when a Spring Session (HttpSession) is ended.
\ No newline at end of file
diff --git a/docs/spring-session/en/whats-new.md b/docs/spring-session/en/whats-new.md
deleted file mode 100644
index a496b02ec4fe08ca0e5ff7954678e3cda82f0e9e..0000000000000000000000000000000000000000
--- a/docs/spring-session/en/whats-new.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# What’s New
-
-Check also the Spring Session BOM [release notes](https://github.com/spring-projects/spring-session-bom/wiki#release-notes)for a list of new and noteworthy features, as well as upgrade instructions for each release.
\ No newline at end of file
diff --git a/docs/spring-session/http-session.md b/docs/spring-session/http-session.md
index db1d190b1b22d590938e75c137f5ebec65a536db..4d561553c88d93eb2f1da86c9a48202d4a0d3f0a 100644
--- a/docs/spring-session/http-session.md
+++ b/docs/spring-session/http-session.md
@@ -1,12 +1,12 @@
# `HttpSession`积分
-Spring 会话提供了与`HttpSession`的透明集成。这意味着开发人员可以使用 Spring 会话支持的实现来切换`HttpSession`实现。
+Spring Session 提供了与`HttpSession`的透明集成。这意味着开发人员可以使用 Spring Session 支持的实现来切换`HttpSession`实现。
## [](#httpsession-why)为什么 Spring session 和`HttpSession`?
-我们已经提到, Spring 会话提供了与`HttpSession`的透明集成,但是我们从中得到了什么好处呢?
+我们已经提到, Spring Session 提供了与`HttpSession`的透明集成,但是我们从中得到了什么好处呢?
-* **群集会话**: Spring 会话使得在不绑定到特定于应用程序容器的解决方案的情况下支持[群集会话](#httpsession-redis)变得非常简单。
+* **群集会话**: Spring Session 使得在不绑定到特定于应用程序容器的解决方案的情况下支持[群集会话](#httpsession-redis)变得非常简单。
* **RESTful API**: Spring session 让在 header 中提供会话 ID 可以与[RESTful API](#httpsession-rest)一起工作
@@ -22,12 +22,12 @@ Spring 会话提供了与`HttpSession`的透明集成。这意味着开发人员
这一节描述了如何使用基于 Java 的配置使用 Redis 来支持`HttpSession`。
-| |[HttpSession 示例](samples.html#samples)提供了如何使用 Java 配置集成 Spring 会话和`HttpSession`的工作示例, 你可以在接下来的几节中阅读集成的基本步骤,但是,我们鼓励你在与自己的应用程序集成时遵循详细的 HttpSession 指南。|
+| |[HttpSession 示例](samples.html#samples)提供了如何使用 Java 配置集成 Spring Session 和`HttpSession`的工作示例, 你可以在接下来的几节中阅读集成的基本步骤,但是,我们鼓励你在与自己的应用程序集成时遵循详细的 HttpSession 指南。|
|---|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
#### [](#httpsession-spring-configuration) Spring Java 配置
-在添加了所需的依赖关系之后,我们就可以创建我们的 Spring 配置了。 Spring 配置负责创建一个 Servlet 过滤器,该过滤器将`HttpSession`实现替换为由 Spring 会话支持的实现。为此,添加以下 Spring 配置:
+在添加了所需的依赖关系之后,我们就可以创建我们的 Spring 配置了。 Spring 配置负责创建一个 Servlet 过滤器,该过滤器将`HttpSession`实现替换为由 Spring Session 支持的实现。为此,添加以下 Spring 配置:
```
@EnableRedisHttpSession (1)
@@ -41,15 +41,15 @@ public class Config {
}
```
-|**1**|`@EnableRedisHttpSession`注释创建了一个名为`springSessionRepositoryFilter`的 Spring Bean,它实现了`Filter`。 过滤器负责替换要由 Spring 会话支持的`HttpSession`实现。 在此实例中, Spring 会话由 Redis 支持。|
+|**1**|`@EnableRedisHttpSession`注释创建了一个名为`springSessionRepositoryFilter`的 Spring Bean,它实现了`Filter`。 过滤器负责替换要由 Spring Session 支持的`HttpSession`实现。 在此实例中, Spring Session 由 Redis 支持。|
|-----|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-|**2**|我们创建一个`RedisConnectionFactory`将 Spring 会话连接到 Redis 服务器。 我们将连接配置为在默认端口(6379)上连接到 localhost。 有关配置 Spring 数据 Redis 的更多信息,请参见[参考文献](https://docs.spring.io/spring-data/data-redis/docs/2.6.2/reference/html/)。|
+|**2**|我们创建一个`RedisConnectionFactory`将 Spring Session 连接到 Redis 服务器。 我们将连接配置为在默认端口(6379)上连接到 localhost。 有关配置 Spring 数据 Redis 的更多信息,请参见[参考文献](https://docs.spring.io/spring-data/data-redis/docs/2.6.2/reference/html/)。|
#### [](#_java_servlet_container_initialization)Java Servlet 容器初始化
-我们的[Spring Configuration](#httpsession-spring-configuration)创建了一个名为`springSessionRepositoryFilter`的 Spring Bean,它实现了`Filter`。`springSessionRepositoryFilter` Bean 负责用 Spring 会话支持的自定义实现替换`HttpSession`。
+我们的[Spring Configuration](#httpsession-spring-configuration)创建了一个名为`springSessionRepositoryFilter`的 Spring Bean,它实现了`Filter`。`springSessionRepositoryFilter` Bean 负责用 Spring Session 支持的自定义实现替换`HttpSession`。
-为了让我们的`Filter`发挥其魔力, Spring 需要加载我们的`Config`类。最后,我们需要确保我们的 Servlet 容器(即 Tomcat)为每个请求使用我们的`springSessionRepositoryFilter`。幸运的是, Spring 会话提供了一个名为`AbstractHttpSessionApplicationInitializer`的实用程序类,以使这两个步骤都变得容易。以下是一个例子:
+为了让我们的`Filter`发挥其魔力, Spring 需要加载我们的`Config`类。最后,我们需要确保我们的 Servlet 容器(即 Tomcat)为每个请求使用我们的`springSessionRepositoryFilter`。幸运的是, Spring Session 提供了一个名为`AbstractHttpSessionApplicationInitializer`的实用程序类,以使这两个步骤都变得容易。以下是一个例子:
SRC/main/java/sample/initializer.java
@@ -74,12 +74,12 @@ public class Initializer extends AbstractHttpSessionApplicationInitializer { (1)
本节介绍如何使用基于 XML 的配置使用 Redis 来支持`HttpSession`。
-| |[HttpSession XML 示例](samples.html#samples)提供了如何使用 XML 配置集成 Spring 会话和`HttpSession`的工作示例, 你可以在接下来的几个部分中阅读集成的基本步骤,但是,我们鼓励你在与自己的应用程序集成时遵循详细的 HttpSession XML 指南。|
+| |[HttpSession XML 示例](samples.html#samples)提供了如何使用 XML 配置集成 Spring Session 和`HttpSession`的工作示例, 你可以在接下来的几个部分中阅读集成的基本步骤,但是,我们鼓励你在与自己的应用程序集成时遵循详细的 HttpSession XML 指南。|
|---|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
#### [](#httpsession-xml-spring-configuration) Spring xml 配置
-在添加了所需的依赖关系之后,我们就可以创建我们的 Spring 配置了。 Spring 配置负责创建一个 Servlet 过滤器,该过滤器将`HttpSession`实现替换为由 Spring 会话支持的实现。为此,添加以下 Spring 配置:
+在添加了所需的依赖关系之后,我们就可以创建我们的 Spring 配置了。 Spring 配置负责创建一个 Servlet 过滤器,该过滤器将`HttpSession`实现替换为由 Spring Session 支持的实现。为此,添加以下 Spring 配置:
SRC/main/webapp/WEB-INF/ Spring/session.xml
@@ -92,13 +92,13 @@ SRC/main/webapp/WEB-INF/ Spring/session.xml
```
-|**1**|我们使用` `和`RedisHttpSessionConfiguration`的组合,因为 Spring 会话尚未提供 XML 名称空间支持(参见[gh-104](https://github.com/spring-projects/spring-session/issues/104))。 这将创建一个名称为`springSessionRepositoryFilter`的 Spring Bean 实现`Filter`。 过滤器负责替换要由 Spring 会话支持的`HttpSession`实现。 在此实例中, Spring 会话由 Redis 支持。|
+|**1**|我们使用` `和`RedisHttpSessionConfiguration`的组合,因为 Spring Session 尚未提供 XML 名称空间支持(参见[gh-104](https://github.com/spring-projects/spring-session/issues/104))。 这将创建一个名称为`springSessionRepositoryFilter`的 Spring Bean 实现`Filter`。 过滤器负责替换要由 Spring Session 支持的`HttpSession`实现。 在此实例中, Spring Session 由 Redis 支持。|
|-----|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-|**2**|我们创建一个`RedisConnectionFactory`将 Spring 会话连接到 Redis 服务器。 我们将连接配置为在默认端口(6379) 上连接到 localhost。有关配置 Spring 数据 Redis 的更多信息,请参见[参考文献](https://docs.spring.io/spring-data/data-redis/docs/2.6.2/reference/html/)。|
+|**2**|我们创建一个`RedisConnectionFactory`将 Spring Session 连接到 Redis 服务器。 我们将连接配置为在默认端口(6379) 上连接到 localhost。有关配置 Spring 数据 Redis 的更多信息,请参见[参考文献](https://docs.spring.io/spring-data/data-redis/docs/2.6.2/reference/html/)。|
#### [](#_xml_servlet_container_initialization)xml Servlet 容器初始化
-我们的[Spring Configuration](#httpsession-xml-spring-configuration)创建了一个名为`springSessionRepositoryFilter`的 Spring Bean,它实现了`Filter`。`springSessionRepositoryFilter` Bean 负责用 Spring 会话支持的自定义实现替换`HttpSession`。
+我们的[Spring Configuration](#httpsession-xml-spring-configuration)创建了一个名为`springSessionRepositoryFilter`的 Spring Bean,它实现了`Filter`。`springSessionRepositoryFilter` Bean 负责用 Spring Session 支持的自定义实现替换`HttpSession`。
为了使我们的`Filter`发挥其魔力,我们需要指示 Spring 加载我们的`session.xml`配置。我们可以通过以下配置来实现这一点:
@@ -145,7 +145,7 @@ SRC/main/webapp/WEB-INF/web.xml
本节介绍如何使用基于 Java 的配置使用 Mongo 返回`HttpSession`。
-| |[HttpSession Mongo 示例](#samples)提供了一个工作示例,说明如何使用 Java 配置集成 Spring 会话和`HttpSession`。 你可以阅读下面的集成基本步骤,但鼓励你在与自己的应用程序集成时遵循详细的 HttpSession 指南。|
+| |[HttpSession Mongo 示例](#samples)提供了一个工作示例,说明如何使用 Java 配置集成 Spring Session 和`HttpSession`。 你可以阅读下面的集成基本步骤,但鼓励你在与自己的应用程序集成时遵循详细的 HttpSession 指南。|
|---|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
你所要做的就是添加以下 Spring 配置:
@@ -170,7 +170,7 @@ public class HttpSessionConfig {
为了能够在 MongoDB 中持久化会话对象,我们需要提供序列化/反序列化机制。
-默认情况下, Spring 会话 MongoDB 将使用`JdkMongoSessionConverter`。
+默认情况下, Spring Session MongoDB 将使用`JdkMongoSessionConverter`。
但是,只需在启动应用程序中添加以下代码,就可以切换到`JacksonMongoSessionConverter`:
@@ -222,7 +222,7 @@ static class Config extends BaseConfig {
## [](#httpsession-jdbc)`HttpSession`with JDBC
-通过在使用`HttpSession`的任何内容之前添加一个 Servlet 过滤器,可以使用与`HttpSession`的 Spring 会话。你可以选择以下任何一种方式:
+通过在使用`HttpSession`的任何内容之前添加一个 Servlet 过滤器,可以使用与`HttpSession`的 Spring Session 。你可以选择以下任何一种方式:
* [基于 Java 的配置](#httpsession-jdbc-jc)
@@ -234,12 +234,12 @@ static class Config extends BaseConfig {
本节描述了在使用基于 Java 的配置时如何使用关系数据库来备份`HttpSession`。
-| |[HttpSession JDBC 示例](samples.html#samples)提供了如何通过使用 Java 配置来集成 Spring 会话和`HttpSession`的工作示例, 你可以在接下来的几个部分中阅读集成的基本步骤,但我们鼓励你在与自己的应用程序集成时遵循详细的 HttpSession JDBC 指南。|
+| |[HttpSession JDBC 示例](samples.html#samples)提供了如何通过使用 Java 配置来集成 Spring Session 和`HttpSession`的工作示例, 你可以在接下来的几个部分中阅读集成的基本步骤,但我们鼓励你在与自己的应用程序集成时遵循详细的 HttpSession JDBC 指南。|
|---|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
#### [](#httpsession-jdbc-spring-configuration) Spring Java 配置
-在添加了所需的依赖关系之后,我们就可以创建我们的 Spring 配置了。 Spring 配置负责创建一个 Servlet 过滤器,该过滤器用 Spring 会话支持的实现替换`HttpSession`实现。为此,添加以下 Spring 配置:
+在添加了所需的依赖关系之后,我们就可以创建我们的 Spring 配置了。 Spring 配置负责创建一个 Servlet 过滤器,该过滤器用 Spring Session 支持的实现替换`HttpSession`实现。为此,添加以下 Spring 配置:
```
@EnableJdbcHttpSession (1)
@@ -259,18 +259,18 @@ public class Config {
}
```
-|**1**|`@EnableJdbcHttpSession`注释创建了一个名为`springSessionRepositoryFilter`的 Spring Bean。 该 Bean 实现了`Filter`。 过滤器负责替换要由 Spring 会话支持的`HttpSession`实现。 在此实例中, Spring 会话是由关系数据库支持的。|
+|**1**|`@EnableJdbcHttpSession`注释创建了一个名为`springSessionRepositoryFilter`的 Spring Bean。 该 Bean 实现了`Filter`。 过滤器负责替换要由 Spring Session 支持的`HttpSession`实现。 在此实例中, Spring Session 是由关系数据库支持的。|
|-----|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-|**2**|我们创建了一个`dataSource`,它将 Spring 会话连接到 H2 数据库的嵌入式实例。 我们通过使用 Spring 会话中包含的 SQL 脚本来配置 H2 数据库来创建数据库表。|
+|**2**|我们创建了一个`dataSource`,它将 Spring Session 连接到 H2 数据库的嵌入式实例。 我们通过使用 Spring Session 中包含的 SQL 脚本来配置 H2 数据库来创建数据库表。|
|**3**|我们创建一个`transactionManager`,它管理先前配置的`dataSource`的事务。|
有关如何配置与数据访问相关的问题的更多信息,请参见[Spring Framework Reference Documentation](https://docs.spring.io/spring/docs/5.3.16/spring-framework-reference/data-access.html)。
#### [](#_java_servlet_container_initialization_2)Java Servlet 容器初始化
-我们的[Spring Configuration](#httpsession-jdbc-spring-configuration)创建了一个名为`springSessionRepositoryFilter`的 Spring Bean,它实现了`Filter`。`springSessionRepositoryFilter` Bean 负责用 Spring 会话支持的自定义实现替换`HttpSession`。
+我们的[Spring Configuration](#httpsession-jdbc-spring-configuration)创建了一个名为`springSessionRepositoryFilter`的 Spring Bean,它实现了`Filter`。`springSessionRepositoryFilter` Bean 负责用 Spring Session 支持的自定义实现替换`HttpSession`。
-为了让我们的`Filter`发挥其魔力, Spring 需要加载我们的`Config`类。最后,我们需要确保我们的 Servlet 容器(即 Tomcat)为每个请求使用我们的`springSessionRepositoryFilter`。幸运的是, Spring 会话提供了一个名为`AbstractHttpSessionApplicationInitializer`的实用程序类,以使这两个步骤都变得容易。下面的示例展示了如何做到这一点:
+为了让我们的`Filter`发挥其魔力, Spring 需要加载我们的`Config`类。最后,我们需要确保我们的 Servlet 容器(即 Tomcat)为每个请求使用我们的`springSessionRepositoryFilter`。幸运的是, Spring Session 提供了一个名为`AbstractHttpSessionApplicationInitializer`的实用程序类,以使这两个步骤都变得容易。下面的示例展示了如何做到这一点:
SRC/main/java/sample/initializer.java
@@ -293,7 +293,7 @@ public class Initializer extends AbstractHttpSessionApplicationInitializer { (1)
#### [](#_multiple_datasources)多个数据源
-Spring 会话提供了`@SpringSessionDataSource`限定符,允许你显式地声明应该在`JdbcIndexedSessionRepository`中注入哪个`DataSource` Bean。这在应用程序上下文中存在多个`DataSource`bean 的场景中特别有用。
+Spring Session 提供了`@SpringSessionDataSource`限定符,允许你显式地声明应该在`JdbcIndexedSessionRepository`中注入哪个`DataSource` Bean。这在应用程序上下文中存在多个`DataSource`bean 的场景中特别有用。
下面的示例展示了如何做到这一点:
@@ -317,19 +317,19 @@ public class Config {
}
```
-|**1**|此限定符声明 Spring 会话将使用 FirstDataSource。|
+|**1**|此限定符声明 Spring Session 将使用 FirstDataSource。|
|-----|-----------------------------------------------------------------------------|
### [](#httpsession-jdbc-xml)基于 XML 的 JDBC 配置
本节描述了在使用基于 XML 的配置时如何使用关系数据库来备份`HttpSession`。
-| |[HttpSession JDBC XML 示例](samples.html#samples)提供了如何通过使用 XML 配置来集成 Spring 会话和`HttpSession`的工作示例, 你可以在接下来的几个部分中阅读集成的基本步骤,但是,我们鼓励你在与自己的应用程序集成时遵循详细的 HttpSession JDBC XML 指南。|
+| |[HttpSession JDBC XML 示例](samples.html#samples)提供了如何通过使用 XML 配置来集成 Spring Session 和`HttpSession`的工作示例, 你可以在接下来的几个部分中阅读集成的基本步骤,但是,我们鼓励你在与自己的应用程序集成时遵循详细的 HttpSession JDBC XML 指南。|
|---|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
#### [](#httpsession-jdbc-xml-spring-configuration) Spring xml 配置
-在添加了所需的依赖关系之后,我们可以创建我们的 Spring 配置。 Spring 配置负责创建一个 Servlet 过滤器,该过滤器用 Spring 会话支持的实现替换`HttpSession`实现。下面的清单显示了如何添加以下 Spring 配置:
+在添加了所需的依赖关系之后,我们可以创建我们的 Spring 配置。 Spring 配置负责创建一个 Servlet 过滤器,该过滤器用 Spring Session 支持的实现替换`HttpSession`实现。下面的清单显示了如何添加以下 Spring 配置:
SRC/main/webapp/WEB-INF/ Spring/session.xml
@@ -349,16 +349,16 @@ SRC/main/webapp/WEB-INF/ Spring/session.xml
```
-|**1**|我们使用` `的组合和`JdbcHttpSessionConfiguration`因为 Spring session 尚未提供 XML 名称空间支持(参见[gh-104](https://github.com/spring-projects/spring-session/issues/104))。 这将创建一个名为`springSessionRepositoryFilter`的 Spring Bean。 Bean 实现`Filter`。 过滤器负责替换要由 Spring session 支持的`HttpSession`实现。 在此实例中, Spring 会话由关系数据库支持。|
+|**1**|我们使用` `的组合和`JdbcHttpSessionConfiguration`因为 Spring session 尚未提供 XML 名称空间支持(参见[gh-104](https://github.com/spring-projects/spring-session/issues/104))。 这将创建一个名为`springSessionRepositoryFilter`的 Spring Bean。 Bean 实现`Filter`。 过滤器负责替换要由 Spring session 支持的`HttpSession`实现。 在此实例中, Spring Session 由关系数据库支持。|
|-----|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-|**2**|我们创建一个`dataSource`,它将 Spring 会话连接到 H2 数据库的嵌入式实例。 我们通过使用 Spring 会话中包含的 SQL 脚本配置 H2 数据库来创建数据库表。|
+|**2**|我们创建一个`dataSource`,它将 Spring Session 连接到 H2 数据库的嵌入式实例。 我们通过使用 Spring Session 中包含的 SQL 脚本配置 H2 数据库来创建数据库表。|
|**3**|我们创建一个`transactionManager`,它管理先前配置的`dataSource`的事务。|
有关如何配置与数据访问相关的问题的更多信息,请参见[Spring Framework Reference Documentation](https://docs.spring.io/spring/docs/5.3.16/spring-framework-reference/data-access.html)。
#### [](#_xml_servlet_container_initialization_2)xml Servlet 容器初始化
-我们的[Spring Configuration](#httpsession-jdbc-xml-spring-configuration)创建了一个名为`springSessionRepositoryFilter`的 Spring Bean,它实现了`Filter`。`springSessionRepositoryFilter` Bean 负责用 Spring 会话支持的自定义实现替换`HttpSession`。
+我们的[Spring Configuration](#httpsession-jdbc-xml-spring-configuration)创建了一个名为`springSessionRepositoryFilter`的 Spring Bean,它实现了`Filter`。`springSessionRepositoryFilter` Bean 负责用 Spring Session 支持的自定义实现替换`HttpSession`。
为了使我们的`Filter`发挥其魔力,我们需要指示 Spring 加载我们的`session.xml`配置。我们的配置如下:
@@ -403,12 +403,12 @@ SRC/main/webapp/WEB-INF/web.xml
本节描述了在使用 Spring 引导时如何使用关系数据库来备份`HttpSession`。
-| |[ HttpSession JDBC Spring Boot Sample](samples.html#samples)提供了如何使用 Spring boot 集成 Spring 会话和`HttpSession`的工作示例, 你可以在接下来的几个部分中阅读集成的基本步骤,但是,我们鼓励你在与自己的应用程序集成时遵循详细的 HttpSession JDBC Spring 引导指南。|
+| |[ HttpSession JDBC Spring Boot Sample](samples.html#samples)提供了如何使用 Spring boot 集成 Spring Session 和`HttpSession`的工作示例, 你可以在接下来的几个部分中阅读集成的基本步骤,但是,我们鼓励你在与自己的应用程序集成时遵循详细的 HttpSession JDBC Spring 引导指南。|
|---|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
#### [](#httpsession-jdbc-boot-spring-configuration) Spring 引导配置
-在添加了所需的依赖项之后,我们可以创建我们的 Spring 引导配置。多亏了一流的自动配置支持,在关系数据库支持下设置 Spring 会话就像向`application.properties`添加一个配置属性一样简单。下面的清单展示了如何做到这一点:
+在添加了所需的依赖项之后,我们可以创建我们的 Spring 引导配置。多亏了一流的自动配置支持,在关系数据库支持下设置 Spring Session 就像向`application.properties`添加一个配置属性一样简单。下面的清单展示了如何做到这一点:
SRC/主/资源/应用程序.properties
@@ -416,9 +416,9 @@ SRC/主/资源/应用程序.properties
spring.session.store-type=jdbc # Session store type.
```
-如果在 Classpath 上存在单个 Spring 会话模块,则 Spring 引导自动使用该存储实现。如果有多个实现,则必须选择要用来存储会话的 StoreType,如上面所示。
+如果在 Classpath 上存在单个 Spring Session 模块,则 Spring 引导自动使用该存储实现。如果有多个实现,则必须选择要用来存储会话的 StoreType,如上面所示。
-Spring Boot 应用的配置相当于手动添加`@EnableJdbcHttpSession`注释。这将创建一个名为`springSessionRepositoryFilter`的 Spring Bean。 Bean 实现`Filter`。过滤器负责替换要由 Spring 会话支持的`HttpSession`实现。
+Spring Boot 应用的配置相当于手动添加`@EnableJdbcHttpSession`注释。这将创建一个名为`springSessionRepositoryFilter`的 Spring Bean。 Bean 实现`Filter`。过滤器负责替换要由 Spring Session 支持的`HttpSession`实现。
你可以使用`application.properties`来进一步自定义。下面的清单展示了如何做到这一点:
@@ -435,7 +435,7 @@ spring.session.jdbc.table-name=SPRING_SESSION # Name of the database table used
#### [](#httpsession-jdbc-boot-configuration)配置`DataSource`
-Spring 启动会自动创建`DataSource`,该会话将 Spring 会话连接到 H2 数据库的嵌入式实例。在生产环境中,你需要更新配置以指向关系数据库。例如,你可以在应用程序中包含以下内容:
+Spring 启动会自动创建`DataSource`,该会话将 Spring Session 连接到 H2 数据库的嵌入式实例。在生产环境中,你需要更新配置以指向关系数据库。例如,你可以在应用程序中包含以下内容:
SRC/主/资源/应用程序.properties
@@ -449,7 +449,7 @@ spring.datasource.password= # Login password of the database.
#### [](#httpsession-jdbc-boot-servlet-configuration) Servlet 容器初始化
-我们的[Spring Boot Configuration](#httpsession-jdbc-boot-spring-configuration)创建了一个名为`springSessionRepositoryFilter`的 Spring Bean,它实现了`Filter`。`springSessionRepositoryFilter` Bean 负责用 Spring 会话支持的自定义实现替换`HttpSession`。
+我们的[Spring Boot Configuration](#httpsession-jdbc-boot-spring-configuration)创建了一个名为`springSessionRepositoryFilter`的 Spring Bean,它实现了`Filter`。`springSessionRepositoryFilter` Bean 负责用 Spring Session 支持的自定义实现替换`HttpSession`。
为了让我们的`Filter`发挥其魔力, Spring 需要加载我们的`Config`类。最后,我们需要确保我们的 Servlet 容器(即 Tomcat)为每个请求使用我们的`springSessionRepositoryFilter`。幸运的是,Boot 为我们解决了这两个步骤。
@@ -459,12 +459,12 @@ spring.datasource.password= # Login password of the database.
本节介绍如何使用基于 Java 的配置使用 HazelCast 来支持`HttpSession`。
-| |[ Hazelcast Spring Sample](samples.html#samples)提供了如何通过使用 Java 配置来集成 Spring 会话和`HttpSession`的工作示例, 你可以在接下来的几个部分中阅读集成的基本步骤,但是,我们鼓励你在与自己的应用程序集成时遵循详细的 Hazelcast Spring 指南。|
+| |[ Hazelcast Spring Sample](samples.html#samples)提供了如何通过使用 Java 配置来集成 Spring Session 和`HttpSession`的工作示例, 你可以在接下来的几个部分中阅读集成的基本步骤,但是,我们鼓励你在与自己的应用程序集成时遵循详细的 Hazelcast Spring 指南。|
|---|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
### [](#security-spring-configuration) Spring 配置
-在添加了所需的依赖关系之后,我们可以创建我们的 Spring 配置。 Spring 配置负责创建 Servlet 过滤器,该过滤器用 Spring 会话支持的实现替换`HttpSession`实现。为此,添加以下 Spring 配置:
+在添加了所需的依赖关系之后,我们可以创建我们的 Spring 配置。 Spring 配置负责创建 Servlet 过滤器,该过滤器用 Spring Session 支持的实现替换`HttpSession`实现。为此,添加以下 Spring 配置:
```
@EnableHazelcastHttpSession (1)
@@ -489,18 +489,18 @@ public class HazelcastHttpSessionConfig {
}
```
-|**1**|`@EnableHazelcastHttpSession`注释创建了一个名为`springSessionRepositoryFilter`的 Spring Bean,它实现了`Filter`。 过滤器负责替换要由 Spring 会话支持的`HttpSession`实现。 在此实例中, Spring 会话由 Hazelcast 支持。|
+|**1**|`@EnableHazelcastHttpSession`注释创建了一个名为`springSessionRepositoryFilter`的 Spring Bean,它实现了`Filter`。 过滤器负责替换要由 Spring Session 支持的`HttpSession`实现。 在此实例中, Spring Session 由 Hazelcast 支持。|
|-----|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-|**2**|为了支持通过主名索引检索会话,需要注册一个适当的`ValueExtractor`。 Spring 会话为此提供了`PrincipalNameExtractor`。|
+|**2**|为了支持通过主名索引检索会话,需要注册一个适当的`ValueExtractor`。 Spring Session 为此提供了`PrincipalNameExtractor`。|
|**3**|为了有效地序列化`MapSession`对象,需要注册`HazelcastSessionSerializer`。如果未设置 ,HazelCast 将使用本机 Java 序列化来序列化会话。|
-|**4**|我们创建一个`HazelcastInstance`将 Spring 会话连接到 Hazelcast。 默认情况下,应用程序启动并连接到 Hazelcast 的嵌入式实例。 有关配置 Hazelcast 的更多信息,请参见[参考文献](https://docs.hazelcast.org/docs/3.12.12/manual/html-single/index.html#hazelcast-configuration)。|
+|**4**|我们创建一个`HazelcastInstance`将 Spring Session 连接到 Hazelcast。 默认情况下,应用程序启动并连接到 Hazelcast 的嵌入式实例。 有关配置 Hazelcast 的更多信息,请参见[参考文献](https://docs.hazelcast.org/docs/3.12.12/manual/html-single/index.html#hazelcast-configuration)。|
| |如果`HazelcastSessionSerializer`是首选的,则需要在所有 Hazelcast 集群成员启动之前对其进行配置。 在 Hazelcast 集群中,所有成员都应该对会话使用相同的序列化方法。此外,如果使用了 HazelCast 客户机/服务器拓扑 ,那么成员和客户机都必须使用相同的序列化方法。序列化器可以通过`ClientConfig`与`SerializerConfiguration`相同的成员来注册。|
|---|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
### [](#_servlet_container_initialization) Servlet 容器初始化
-我们的[Spring Configuration](guides/java-security.html#security-spring-configuration)创建了一个名为`springSessionRepositoryFilter`的 Spring Bean,它实现了`Filter`。`springSessionRepositoryFilter` Bean 负责用 Spring 会话支持的自定义实现替换`HttpSession`。
+我们的[Spring Configuration](guides/java-security.html#security-spring-configuration)创建了一个名为`springSessionRepositoryFilter`的 Spring Bean,它实现了`Filter`。`springSessionRepositoryFilter` Bean 负责用 Spring Session 支持的自定义实现替换`HttpSession`。
为了让我们的`Filter`发挥其魔力, Spring 需要加载我们的`SessionConfig`类。由于我们的应用程序已经通过使用`SecurityInitializer`类加载了 Spring 配置,因此我们可以将`SessionConfig`类添加到其中。下面的清单展示了如何做到这一点:
@@ -516,7 +516,7 @@ public class SecurityInitializer extends AbstractSecurityWebApplicationInitializ
}
```
-最后,我们需要确保我们的 Servlet 容器(即 Tomcat)为每个请求使用我们的`springSessionRepositoryFilter`。在 Spring security 的`springSecurityFilterChain`之前调用 Spring session 的`springSessionRepositoryFilter`是极其重要的。这样做可以确保 Spring 安全性使用的`HttpSession`得到 Spring 会话的支持。幸运的是, Spring Session 提供了一个名为`AbstractHttpSessionApplicationInitializer`的实用程序类,这使得这样做很容易。下面的示例展示了如何做到这一点:
+最后,我们需要确保我们的 Servlet 容器(即 Tomcat)为每个请求使用我们的`springSessionRepositoryFilter`。在 Spring security 的`springSecurityFilterChain`之前调用 Spring session 的`springSessionRepositoryFilter`是极其重要的。这样做可以确保 Spring 安全性使用的`HttpSession`得到 Spring Session 的支持。幸运的是, Spring Session 提供了一个名为`AbstractHttpSessionApplicationInitializer`的实用程序类,这使得这样做很容易。下面的示例展示了如何做到这一点:
SRC/main/java/sample/initializer.java
@@ -535,7 +535,7 @@ public class Initializer extends AbstractHttpSessionApplicationInitializer {
幸运的是,`HttpSession`和`HttpServletRequest`(获取`HttpSession`的 API)都是接口。这意味着我们可以为这些 API 中的每一个提供我们自己的实现。
-| |本节描述 Spring 会话如何提供与`HttpSession`的透明集成。我们提供这些内容,这样你就可以了解幕后发生了什么。这个功能已经集成了,你不需要自己实现这个逻辑。|
+| |本节描述 Spring Session 如何提供与`HttpSession`的透明集成。我们提供这些内容,这样你就可以了解幕后发生了什么。这个功能已经集成了,你不需要自己实现这个逻辑。|
|---|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
首先,我们创建一个自定义的`HttpServletRequest`,它返回一个`HttpSession`的自定义实现。它看起来是这样的:
@@ -578,18 +578,18 @@ public class SessionRepositoryFilter implements Filter {
}
```
-通过将自定义`HttpServletRequest`实现传递到`FilterChain`中,我们确保在`Filter`之后调用的任何内容都使用自定义`HttpSession`实现。这突出了为什么将 Spring 会话的`SessionRepositoryFilter`放在与`HttpSession`交互的任何事物之前是很重要的。
+通过将自定义`HttpServletRequest`实现传递到`FilterChain`中,我们确保在`Filter`之后调用的任何内容都使用自定义`HttpSession`实现。这突出了为什么将 Spring Session 的`SessionRepositoryFilter`放在与`HttpSession`交互的任何事物之前是很重要的。
## [](#httpsession-rest)`HttpSession`和 RESTful API
-Spring 会话可以通过让会话在头文件中提供而与 RESTful API 一起工作。
+Spring Session 可以通过让会话在头文件中提供而与 RESTful API 一起工作。
-| |[剩余样本](samples.html#samples)提供了一个工作示例,说明如何在 REST 应用程序中使用 Spring 会话来支持使用头部进行身份验证, 你可以遵循下面几节中描述的集成的基本步骤,但是,我们鼓励你在与自己的应用程序集成时遵循详细的 REST 指南。|
+| |[剩余样本](samples.html#samples)提供了一个工作示例,说明如何在 REST 应用程序中使用 Spring Session 来支持使用头部进行身份验证, 你可以遵循下面几节中描述的集成的基本步骤,但是,我们鼓励你在与自己的应用程序集成时遵循详细的 REST 指南。|
|---|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
### [](#rest-spring-configuration) Spring 配置
-在添加了所需的依赖关系之后,我们可以创建我们的 Spring 配置。 Spring 配置负责创建一个 Servlet 过滤器,该过滤器将`HttpSession`实现替换为由 Spring 会话支持的实现。为此,添加以下 Spring 配置:
+在添加了所需的依赖关系之后,我们可以创建我们的 Spring 配置。 Spring 配置负责创建一个 Servlet 过滤器,该过滤器将`HttpSession`实现替换为由 Spring Session 支持的实现。为此,添加以下 Spring 配置:
```
@Configuration
@@ -609,14 +609,14 @@ public class HttpSessionConfig {
}
```
-|**1**|`@EnableRedisHttpSession`注释创建了一个名为`springSessionRepositoryFilter`的 Spring Bean,它实现了`Filter`。 过滤器负责替换要由 Spring 会话支持的`HttpSession`实现。 在此实例中, Spring 会话由 Redis 支持。|
+|**1**|`@EnableRedisHttpSession`注释创建了一个名为`springSessionRepositoryFilter`的 Spring Bean,它实现了`Filter`。 过滤器负责替换要由 Spring Session 支持的`HttpSession`实现。 在此实例中, Spring Session 由 Redis 支持。|
|-----|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-|**2**|我们创建一个`RedisConnectionFactory`将 Spring 会话连接到 Redis 服务器。 我们将连接配置为在默认端口(6379)上连接到 localhost。 有关配置 Spring 数据 Redis 的更多信息,请参见[参考文献](https://docs.spring.io/spring-data/data-redis/docs/2.6.2/reference/html/)。|
-|**3**|我们定制了 Spring 会话的 HttpSession 集成,以使用 HTTP 头来传递当前会话信息,而不是 Cookie。|
+|**2**|我们创建一个`RedisConnectionFactory`将 Spring Session 连接到 Redis 服务器。 我们将连接配置为在默认端口(6379)上连接到 localhost。 有关配置 Spring 数据 Redis 的更多信息,请参见[参考文献](https://docs.spring.io/spring-data/data-redis/docs/2.6.2/reference/html/)。|
+|**3**|我们定制了 Spring Session 的 HttpSession 集成,以使用 HTTP 头来传递当前会话信息,而不是 Cookie。|
### [](#_servlet_container_initialization_2) Servlet 容器初始化
-我们的[Spring Configuration](#rest-spring-configuration)创建了一个名为`springSessionRepositoryFilter`的 Spring Bean,它实现了`Filter`。`springSessionRepositoryFilter` Bean 负责用 Spring 会话支持的自定义实现替换`HttpSession`。
+我们的[Spring Configuration](#rest-spring-configuration)创建了一个名为`springSessionRepositoryFilter`的 Spring Bean,它实现了`Filter`。`springSessionRepositoryFilter` Bean 负责用 Spring Session 支持的自定义实现替换`HttpSession`。
为了使我们的`Filter`发挥其魔力, Spring 需要加载我们的`Config`类。我们在我们的 Spring `MvcInitializer`中提供了配置,如下例所示:
@@ -629,7 +629,7 @@ protected Class>[] getRootConfigClasses() {
}
```
-最后,我们需要确保我们的 Servlet 容器(即 Tomcat)为每个请求使用我们的`springSessionRepositoryFilter`。幸运的是, Spring 会话提供了一个名为`AbstractHttpSessionApplicationInitializer`的实用程序类,这使得这样做很容易。为此,使用默认构造函数扩展类,如下例所示:
+最后,我们需要确保我们的 Servlet 容器(即 Tomcat)为每个请求使用我们的`springSessionRepositoryFilter`。幸运的是, Spring Session 提供了一个名为`AbstractHttpSessionApplicationInitializer`的实用程序类,这使得这样做很容易。为此,使用默认构造函数扩展类,如下例所示:
SRC/main/java/sample/initializer.java
diff --git a/docs/spring-session/index.md b/docs/spring-session/index.md
index ba5ff795b58d5e2c3109b5306a192bf8470ef3f2..e4972e3b211e2dff120d411d7f115bcf8e506182 100644
--- a/docs/spring-session/index.md
+++ b/docs/spring-session/index.md
@@ -1,8 +1,8 @@
# Spring 会议
-Spring 会话提供了用于管理用户的会话信息的 API 和实现。
+Spring Session 提供了用于管理用户的会话信息的 API 和实现。
-Spring 会话提供了用于管理用户会话信息的 API 和实现,同时也使得在不绑定到特定于应用程序容器的解决方案的情况下支持群集会话变得非常简单。它还提供了以下方面的透明整合:
+Spring Session 提供了用于管理用户会话信息的 API 和实现,同时也使得在不绑定到特定于应用程序容器的解决方案的情况下支持群集会话变得非常简单。它还提供了以下方面的透明整合:
* [HttpSession ](http-session.html#httpsession):允许以与应用程序容器无关的方式替换`HttpSession`,并支持在头文件中提供会话 ID,以便与 RESTful API 一起工作。
@@ -10,9 +10,9 @@ Spring 会话提供了用于管理用户会话信息的 API 和实现,同时
* [WebSession](web-session.html#websession):允许以与应用程序容器无关的方式替换 Spring WebFlux 的`WebSession`。
-## [](#community) Spring 会话社区
+## [](#community) Spring Session 社区
-我们 GLAD 将你视为我们社区的一部分。以下各节提供了有关如何与 Spring 会话社区交互的更多信息。
+我们 GLAD 将你视为我们社区的一部分。以下各节提供了有关如何与 Spring Session 社区交互的更多信息。
### [](#community-support)支持
@@ -32,7 +32,7 @@ Spring 会话提供了用于管理用户会话信息的 API 和实现,同时
### [](#community-license)许可证
-Spring 会话是在[Apache2.0 许可证](https://www.apache.org/licenses/LICENSE-2.0)下发布的开源软件。
+Spring Session 是在[Apache2.0 许可证](https://www.apache.org/licenses/LICENSE-2.0)下发布的开源软件。
### [](#community-extensions)社区扩展
@@ -54,5 +54,5 @@ Spring 场会议的最低要求是:
* `@EnableHazelcastHttpSession`需要 HazelCast3.6+。这是支持[`FindByIndexNameSessionRepository`]所必需的(api.html#api-enablehazelcasthtpsession-storage)
-| |在其核心, Spring 会话仅对`spring-jcl`具有所需的依赖关系。 关于使用 Spring 会话而不使用任何其他 Spring 依赖关系的示例,请参见[Hazelcast 样品](samples.html#samples)应用程序。|
+| |在其核心, Spring Session 仅对`spring-jcl`具有所需的依赖关系。 关于使用 Spring Session 而不使用任何其他 Spring 依赖关系的示例,请参见[Hazelcast 样品](samples.html#samples)应用程序。|
|---|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
\ No newline at end of file
diff --git a/docs/spring-session/modules.md b/docs/spring-session/modules.md
index 94016be69d5b7ff7a0693143b1adbba3cb847029..ad50ee02439b180cb3a4aefd4d91e96ac6c7720e 100644
--- a/docs/spring-session/modules.md
+++ b/docs/spring-session/modules.md
@@ -1,21 +1,21 @@
-# Spring 会话模块
+# Spring Session 模块
在 Spring session1.x 中, Spring session 的所有`SessionRepository`实现都在`spring-session`工件中可用。虽然方便,但这种方法不能长期持续,因为项目中增加了更多的特性和`SessionRepository`实现。
-在 Spring Session2.0 中,将几个模块拆分成独立的模块和托管存储库。 Spring MongoDB 的会话已退役,但后来作为一个单独的模块重新激活。从 Spring 会话 2.6 开始,MongoDB 的 Spring 会话被合并回 Spring 会话。
+在 Spring Session2.0 中,将几个模块拆分成独立的模块和托管存储库。 Spring MongoDB 的会话已退役,但后来作为一个单独的模块重新激活。从 Spring Session 2.6 开始,MongoDB 的 Spring Session 被合并回 Spring Session 。
现在,各种存储库和模块的情况如下:
* [`spring-session`Repository](https://github.com/ Spring-projects/ Spring-session)
- * 主持 Spring 会话核心、 Spring MongoDB 会话、 Spring Redis 会话、 Spring 会话 JDBC 和 Spring 会话 Hazelcast 模块。
+ * 主持 Spring Session 核心、 Spring MongoDB 会话、 Spring Redis 会话、 Spring Session JDBC 和 Spring Session Hazelcast 模块。
* [`spring-session-data-geode`Repository](https://github.com/ Spring-projects/ Spring-session-data-geode)
- * 托管 Spring 会话数据 Geode 模块。 Spring 会话数据 Geode 有其自己的用户指南,你可以在[[https://spring.io/projects/spring-session-data-geode#learn](https://spring.io/projects/spring-session-data-geode#learn)站点]上找到它。
+ * 托管 Spring Session 数据 Geode 模块。 Spring Session 数据 Geode 有其自己的用户指南,你可以在[[https://spring.io/projects/spring-session-data-geode#learn](https://spring.io/projects/spring-session-data-geode#learn)站点]上找到它。
最后, Spring Session 还提供了一个 Maven BOM(“物料清单”)模块,以帮助用户处理版本管理问题:
* [`spring-session-bom`Repository](https://github.com/ Spring-projects/ Spring-session-bom)
- * 主持 Spring 会话 BOM 模块
\ No newline at end of file
+ * 主持 Spring Session BOM 模块
\ No newline at end of file
diff --git a/docs/spring-session/samples.md b/docs/spring-session/samples.md
index 9d80fc40a99a53060a923dd57d095351d38b5454..1f5f9ac5e3bb8e9b02aed67846feb64d7fcb0f28 100644
--- a/docs/spring-session/samples.md
+++ b/docs/spring-session/samples.md
@@ -1,6 +1,6 @@
# 示例和指南(从这里开始)
-要开始使用 Spring 会话,最好的起点是我们的示例应用程序。
+要开始使用 Spring Session ,最好的起点是我们的示例应用程序。
|来源| Description | Guide |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------|
diff --git a/docs/spring-session/spring-security.md b/docs/spring-session/spring-security.md
index 84b599af69d77411a560f4ef49405fc9836b83e0..601e95b3ddd890e2fc38ee990bbb1db9546cfe3f 100644
--- a/docs/spring-session/spring-security.md
+++ b/docs/spring-session/spring-security.md
@@ -1,16 +1,16 @@
# Spring 安全集成
-Spring 会话提供了具有 Spring 安全性的集成。
+Spring Session 提供了具有 Spring 安全性的集成。
## [](#spring-security-rememberme) Spring 安全 Remember-Me 支持
-Spring 会话提供了与[Spring Security’s Remember-me Authentication](https://docs.spring.io/spring-security/site/docs/5.6.2/reference/html5/#servlet-rememberme)的集成。支持:
+Spring Session 提供了与[Spring Security’s Remember-me Authentication](https://docs.spring.io/spring-security/site/docs/5.6.2/reference/html5/#servlet-rememberme)的集成。支持:
* 更改会话过期长度
* 确保会话 cookie 在`Integer.MAX_VALUE`处过期。cookie 过期时间被设置为可能的最大值,因为只有在创建会话时才设置 cookie 过期时间。如果将其设置为与会话到期日相同的值,则会话将在用户使用会话时获得更新,但不会更新 cookie 到期日(导致过期时间固定)。
-要在 Java 配置中配置具有 Spring 安全性的 Spring 会话,可以使用以下清单作为指导:
+要在 Java 配置中配置具有 Spring 安全性的 Spring Session ,可以使用以下清单作为指导:
```
@Override
@@ -48,7 +48,7 @@ public SpringSessionRememberMeServices rememberMeServices() {
## [](#spring-security-concurrent-sessions) Spring 安全并发会话控制
-Spring 会话提供与 Spring 安全性的集成,以支持其并发的会话控制。这允许限制单个用户可以并发的活动会话的数量,但是,与默认的 Spring 安全支持不同,这也适用于集群环境。这是通过提供 Spring Security 的`SessionRegistry`接口的自定义实现来完成的。
+Spring Session 提供与 Spring 安全性的集成,以支持其并发的会话控制。这允许限制单个用户可以并发的活动会话的数量,但是,与默认的 Spring 安全支持不同,这也适用于集群环境。这是通过提供 Spring Security 的`SessionRegistry`接口的自定义实现来完成的。
当使用 Spring Security 的 Java Config DSL 时,你可以通过`SessionManagementConfigurer`配置自定义`SessionRegistry`,如下所示:
@@ -79,7 +79,7 @@ public class SecurityConfiguration extends WebSecurityConfigu
}
```
-这假定你还配置了 Spring 会话,以提供一个`FindByIndexNameSessionRepository`,返回`Session`实例。
+这假定你还配置了 Spring Session ,以提供一个`FindByIndexNameSessionRepository`,返回`Session`实例。
当使用 XML 配置时,它看起来类似于以下清单:
@@ -97,7 +97,7 @@ public class SecurityConfiguration extends WebSecurityConfigu
```
-这假定你的 Spring 会话`SessionRegistry` Bean 被称为`sessionRegistry`,这是所有`SpringHttpSessionConfiguration`子类使用的名称。
+这假定你的 Spring Session `SessionRegistry` Bean 被称为`sessionRegistry`,这是所有`SpringHttpSessionConfiguration`子类使用的名称。
## [](#spring-security-concurrent-sessions-limitations)限制
diff --git a/docs/spring-session/upgrading.md b/docs/spring-session/upgrading.md
index be5656ed9b5233ac729a6d2d7b48f5381afaaf53..02c4af39ad8e80340cb6636a1eb04300ebf4614a 100644
--- a/docs/spring-session/upgrading.md
+++ b/docs/spring-session/upgrading.md
@@ -1,10 +1,10 @@
# 升级到 2.x
-有了新的主要版本, Spring 会话团队利用这个机会进行了一些非被动的更改。这些更改的重点是改进和协调 Spring Session 的 API,以及删除不受欢迎的组件。
+有了新的主要版本, Spring Session 团队利用这个机会进行了一些非被动的更改。这些更改的重点是改进和协调 Spring Session 的 API,以及删除不受欢迎的组件。
## [](#_baseline_update)基线更新
-Spring 会话 2.0 需要 Java8 和 Spring Framework5.0 作为基线,因为其整个代码库现在基于 Java8 源代码。有关升级 Spring 框架的更多信息,请参见[Upgrading to Spring Framework 5.x](https://github.com/spring-projects/spring-framework/wiki/Upgrading-to-Spring-Framework-5.x)。
+Spring Session 2.0 需要 Java8 和 Spring Framework5.0 作为基线,因为其整个代码库现在基于 Java8 源代码。有关升级 Spring 框架的更多信息,请参见[Upgrading to Spring Framework 5.x](https://github.com/spring-projects/spring-framework/wiki/Upgrading-to-Spring-Framework-5.x)。
## [](#_replaced_and_removed_modules)替换和移除模块
@@ -14,13 +14,13 @@ Spring 会话 2.0 需要 Java8 和 Spring Framework5.0 作为基线,因为其
* Spring Redis 会议
-* Spring 会话 JDBC
+* Spring Session JDBC
* Spring 会议 Hazelcast
此外,从主项目存储库中删除了以下内容:
-* Spring 会话数据 Gemfire
+* Spring Session 数据 Gemfire
* [`spring-session-data-geode`](https://github.com/ Spring-projects/ Spring-session-data-geode)
@@ -40,9 +40,9 @@ Spring 会话 2.0 需要 Java8 和 Spring Framework5.0 作为基线,因为其
* `RedisOperationsSessionRepository`使用的 Redis 命名空间现在是完全可配置的,而不是部分可配置的。
-* 已更新了 Redis 配置支持,以避免注册 Spring 会话特定的`RedisTemplate` Bean。
+* 已更新了 Redis 配置支持,以避免注册 Spring Session 特定的`RedisTemplate` Bean。
-* 已更新了 JDBC 配置支持,以避免注册 Spring 会话特定的`JdbcTemplate` Bean。
+* 已更新了 JDBC 配置支持,以避免注册 Spring Session 特定的`JdbcTemplate` Bean。
* 以前不推荐的类和方法已在整个代码库中被删除。
diff --git a/docs/spring-session/web-session.md b/docs/spring-session/web-session.md
index 6ee192317eeb177dcfc162ed4bda083614b114bb..621e4386ca9ac30baa954da4856f651d44fbeb4b 100644
--- a/docs/spring-session/web-session.md
+++ b/docs/spring-session/web-session.md
@@ -1,14 +1,14 @@
# WebSession 集成
-Spring 会话提供了与 Spring WebFlux 的`WebSession`的透明集成。这意味着你可以使用 Spring 会话支持的实现来切换`WebSession`实现。
+Spring Session 提供了与 Spring WebFlux 的`WebSession`的透明集成。这意味着你可以使用 Spring Session 支持的实现来切换`WebSession`实现。
## [](#websession-why)为什么要进行会话和 WebSession?
-我们已经提到, Spring 会话提供了与 Spring WebFlux 的`WebSession`的透明集成,但是我们从中得到了什么好处呢?与`HttpSession`一样, Spring 会话使得在不绑定到特定于应用程序容器的解决方案的情况下支持[群集会话](#websession-redis)变得非常简单。
+我们已经提到, Spring Session 提供了与 Spring WebFlux 的`WebSession`的透明集成,但是我们从中得到了什么好处呢?与`HttpSession`一样, Spring Session 使得在不绑定到特定于应用程序容器的解决方案的情况下支持[群集会话](#websession-redis)变得非常简单。
## [](#websession-redis)与 Redis 的 WebSession
-使用 Spring session with`WebSession`是通过注册一个`WebSessionManager`实现来启用的,该实现由 Spring session 的`ReactiveSessionRepository`支持。 Spring 配置负责创建一个`WebSessionManager`,该实现用 Spring 会话支持的实现替换`WebSession`实现。要做到这一点,请添加以下 Spring 配置:
+使用 Spring session with`WebSession`是通过注册一个`WebSessionManager`实现来启用的,该实现由 Spring session 的`ReactiveSessionRepository`支持。 Spring 配置负责创建一个`WebSessionManager`,该实现用 Spring Session 支持的实现替换`WebSession`实现。要做到这一点,请添加以下 Spring 配置:
```
@EnableRedisWebSession (1)
@@ -22,18 +22,18 @@ public class SessionConfiguration {
}
```
-|**1**|`@EnableRedisWebSession`注释创建了一个名为`webSessionManager`的 Spring Bean。这个 Bean 实现了`WebSessionManager`。 这就是负责替换要由 Spring 会话支持的`WebSession`实现的内容。 在这个实例中, Spring 会话是由 Redis 支持的。|
+|**1**|`@EnableRedisWebSession`注释创建了一个名为`webSessionManager`的 Spring Bean。这个 Bean 实现了`WebSessionManager`。 这就是负责替换要由 Spring Session 支持的`WebSession`实现的内容。 在这个实例中, Spring Session 是由 Redis 支持的。|
|-----|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-|**2**|我们创建一个`RedisConnectionFactory`将 Spring 会话连接到 Redis 服务器。 我们将连接配置为在默认端口(6379) 上连接到 localhost。有关配置 Spring 数据 Redis 的更多信息,请参见[参考文献](https://docs.spring.io/spring-data/data-redis/docs/2.6.2/reference/html/)。|
+|**2**|我们创建一个`RedisConnectionFactory`将 Spring Session 连接到 Redis 服务器。 我们将连接配置为在默认端口(6379) 上连接到 localhost。有关配置 Spring 数据 Redis 的更多信息,请参见[参考文献](https://docs.spring.io/spring-data/data-redis/docs/2.6.2/reference/html/)。|
## [](#websession-how)WebSession 集成如何工作
-与 Servlet API 及其`HttpSession`相比, Spring 会话与 Spring WebFlux 及其`WebSession`集成要容易得多。 Spring WebFlux 提供了`WebSessionStore`API,该 API 提供了用于持久化`WebSession`的策略。
+与 Servlet API 及其`HttpSession`相比, Spring Session 与 Spring WebFlux 及其`WebSession`集成要容易得多。 Spring WebFlux 提供了`WebSessionStore`API,该 API 提供了用于持久化`WebSession`的策略。
-| |本节描述 Spring 会话如何使用`WebSession`提供透明的集成。我们提供这些内容,这样你就可以了解幕后发生了什么。这个功能已经集成了,你不需要自己实现这个逻辑。|
+| |本节描述 Spring Session 如何使用`WebSession`提供透明的集成。我们提供这些内容,这样你就可以了解幕后发生了什么。这个功能已经集成了,你不需要自己实现这个逻辑。|
|---|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-首先,我们创建一个自定义的`SpringSessionWebSession`,它将委托给 Spring 会话的`Session`。它看起来是这样的:
+首先,我们创建一个自定义的`SpringSessionWebSession`,它将委托给 Spring Session 的`Session`。它看起来是这样的:
```
public class SpringSessionWebSession implements WebSession {
diff --git a/docs/spring-session/web-socket.md b/docs/spring-session/web-socket.md
index e46d00fa565e75cbe739ec22fc99d6b2f830733a..4ac2b71e36fbcf080ee6caf29027475c4d003926 100644
--- a/docs/spring-session/web-socket.md
+++ b/docs/spring-session/web-socket.md
@@ -1,13 +1,13 @@
# WebSocket 整合
-Spring 会话提供了 Spring 的 WebSocket 支持的透明集成。
+Spring Session 提供了 Spring 的 WebSocket 支持的透明集成。
| |Spring Session 的 WebSocket 支持仅对 Spring 的 WebSocket 支持有效。 具体来说,它不能直接使用[JSR-356](https://www.jcp.org/en/jsr/detail?id=356),因为 JSR-356 没有拦截传入 WebSocket 消息的机制。|
|---|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
## [](#websocket-why)为什么要使用会话和 WebSockets?
-那么,当我们使用 WebSockets 时,为什么需要 Spring 会话呢?
+那么,当我们使用 WebSockets 时,为什么需要 Spring Session 呢?
考虑一个电子邮件应用程序,它的大部分工作都是通过 HTTP 请求完成的。然而,其中还嵌入了一个聊天应用程序,该应用程序可以在 WebSocket API 上工作。如果用户正在积极地与某人聊天,我们不应该超时`HttpSession`,因为这将是一个非常糟糕的用户体验。然而,这正是[JSR-356](https://java.net/jira/browse/WEBSOCKET_SPEC-175)所做的。
@@ -15,7 +15,7 @@ Spring 会话提供了 Spring 的 WebSocket 支持的透明集成。
## [](#websocket-usage) WebSocket 用法
-[ WebSocket Sample](samples.html#samples)提供了如何将 Spring 会话与 WebSockets 集成的工作示例。你可以遵循下面几个标题中描述的集成的基本步骤,但我们鼓励你在与自己的应用程序集成时遵循详细的 WebSocket 指南。
+[ WebSocket Sample](samples.html#samples)提供了如何将 Spring Session 与 WebSockets 集成的工作示例。你可以遵循下面几个标题中描述的集成的基本步骤,但我们鼓励你在与自己的应用程序集成时遵循详细的 WebSocket 指南。
### [](#websocket-httpsession)`HttpSession`积分
@@ -45,7 +45,7 @@ public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
}
```
-我们可以更新配置以使用 Spring 会话的 WebSocket 支持。下面的示例展示了如何做到这一点:
+我们可以更新配置以使用 Spring Session 的 WebSocket 支持。下面的示例展示了如何做到这一点:
SRC/main/java/samples/config/websocketconfig.java
@@ -69,7 +69,7 @@ public class WebSocketConfig extends AbstractSessionWebSocketMessageBrokerConfig
}
```
-要连接 Spring 会话支持,我们只需要更改两件事:
+要连接 Spring Session 支持,我们只需要更改两件事:
|**1**|而不是实现`WebSocketMessageBrokerConfigurer`,我们扩展`AbstractSessionWebSocketMessageBrokerConfigurer`|
|-----|-----------------------------------------------------------------------------------------------------------------------|
@@ -77,10 +77,10 @@ public class WebSocketConfig extends AbstractSessionWebSocketMessageBrokerConfig
`AbstractSessionWebSocketMessageBrokerConfigurer`在幕后做什么?
-* `WebSocketConnectHandlerDecoratorFactory`作为`WebSocketHandlerDecoratorFactory`添加到`WebSocketTransportRegistration`。这确保了一个包含`WebSocketSession`的自定义`SessionConnectEvent`被触发。当 Spring 会话结束时,要结束任何 WebSocket 仍处于打开状态的连接,`WebSocketSession`是必需的。
+* `WebSocketConnectHandlerDecoratorFactory`作为`WebSocketHandlerDecoratorFactory`添加到`WebSocketTransportRegistration`。这确保了一个包含`WebSocketSession`的自定义`SessionConnectEvent`被触发。当 Spring Session 结束时,要结束任何 WebSocket 仍处于打开状态的连接,`WebSocketSession`是必需的。
* `SessionRepositoryMessageInterceptor`作为`HandshakeInterceptor`添加到每个`StompWebSocketEndpointRegistration`。这确保将`Session`添加到 WebSocket 属性中,以允许更新上次访问的时间。
-* `SessionRepositoryMessageInterceptor`作为`ChannelInterceptor`添加到我们的入站`ChannelRegistration`中。这确保了每次接收入站消息时,都会更新 Spring 会话的最后一次访问时间。
+* `SessionRepositoryMessageInterceptor`作为`ChannelInterceptor`添加到我们的入站`ChannelRegistration`中。这确保了每次接收入站消息时,都会更新 Spring Session 的最后一次访问时间。
-* `WebSocketRegistryListener`被创建为 Spring Bean。这确保了我们将所有`Session`ID 映射到相应的 WebSocket 连接。通过维护此映射,我们可以在 Spring 会话结束时关闭所有 WebSocket 连接。
\ No newline at end of file
+* `WebSocketRegistryListener`被创建为 Spring Bean。这确保了我们将所有`Session`ID 映射到相应的 WebSocket 连接。通过维护此映射,我们可以在 Spring Session 结束时关闭所有 WebSocket 连接。
\ No newline at end of file
diff --git a/docs/spring-session/whats-new.md b/docs/spring-session/whats-new.md
index 862a64c87e9c3e25b93d218ceae4b52e5ebbf979..2f663a6750b2c692eee75191a905b2a5c61aa171 100644
--- a/docs/spring-session/whats-new.md
+++ b/docs/spring-session/whats-new.md
@@ -1,3 +1,3 @@
-# 有什么新鲜事吗?
+# 最新更新
-还请检查 Spring 会话 BOM[发行说明](https://github.com/spring-projects/spring-session-bom/wiki#release-notes),以获取新的和值得注意的功能的列表,以及每个版本的升级说明。
\ No newline at end of file
+还请检查 Spring Session BOM[发行说明](https://github.com/spring-projects/spring-session-bom/wiki#release-notes),以获取新的和值得注意的功能的列表,以及每个版本的升级说明。
\ No newline at end of file