Skip to content

Commit 72b65f4

Browse files
Document that a custom CookieSerializer might break Remember Me
Closes gh-2567
1 parent c97784a commit 72b65f4

File tree

1 file changed

+8
-0
lines changed
  • spring-session-docs/modules/ROOT/pages/configuration

1 file changed

+8
-0
lines changed

spring-session-docs/modules/ROOT/pages/configuration/common.adoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ If the regular expression matches, the first https://docs.oracle.com/javase/tuto
6060
* `sameSite`: The value for the `SameSite` cookie directive.
6161
To disable the serialization of the `SameSite` cookie directive, you may set this value to `null`.
6262
Default: `Lax`
63+
* `rememberMeRequestAttribute`: The request attribute name that indicates remember-me login.
64+
If specified, the cookie will be written as `Integer.MAX_VALUE`.
65+
66+
[NOTE]
67+
====
68+
If you are using `SpringSessionRememberMeServices` and you are declaring a custom `DefaultCookieSerializer` bean, you should set the `rememberMeRequestAttribute` field to ensure that Spring Session relies on session expiration rather than cookie expiration.
69+
To do so, you can use the following code snippet: `defaultCookieSerializer.setRememberMeRequestAttribute(SpringSessionRememberMeServices.REMEMBER_ME_LOGIN_ATTR);`
70+
====
6371

6472
[[custom-cookie-in-webflux]]
6573
=== Custom Cookie in WebFlux

0 commit comments

Comments
 (0)