diff --git a/articles/tools/kubernetes/configuration.adoc b/articles/tools/kubernetes/configuration.adoc index 6a69fd9a86..79092b7dbc 100644 --- a/articles/tools/kubernetes/configuration.adoc +++ b/articles/tools/kubernetes/configuration.adoc @@ -84,3 +84,36 @@ spring: host: redis-service ---- -- + +== Backend Session Expiration Policy + +The backend session expiration policy allows you to define an expiration timeout for the backend stored session. By default, no expiration is set. However, expiration can be activated by setting the `vaadin.kubernetes.backend-session-expiration-tolerance` property. The property defines the amount of time to be added to the HTTP session timeout to determine the expiration of the backend session. If a time unit is not given, milliseconds is assumed. Another option is to provide a custom `SessionExpirationPolicy` bean, which allows you to define a custom expiration timeout, independent of the HTTP session timeout value. + +[.example] +-- +Given an HTTP session timeout of 30 minutes, the session stored in the backend will expire after 35 minutes of inactivity. +[source,properties] +---- + +vaadin.kubernetes.backend-session-expiration-tolerance: 5m +---- + +Given an HTTP session timeout of 30 minutes, the session stored in the backend will expire after 35 minutes of inactivity. +[source,yaml] +---- + +vaadin: + kubernetes: + backend-session-expiration-tolerance: 5m +---- + +The session stored in the backend will expire after 35 minutes of inactivity, regardless of the HTTP session timeout. +[source,java] +---- + +@Bean +SessionExpirationPolicy sessionExpirationPolicy() { + return sessionTimeout -> Duration.ofMinutes(35); +} +---- +--