diff --git a/articles/tools/kubernetes/configuration.adoc b/articles/tools/kubernetes/configuration.adoc index 6a69fd9a86..5c4912a94e 100644 --- a/articles/tools/kubernetes/configuration.adoc +++ b/articles/tools/kubernetes/configuration.adoc @@ -84,3 +84,34 @@ 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, or by providing a custom `SessionExpirationPolicy` bean. 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. + +[.example] +-- +.application.properties +[source,properties] +---- +# Given an HTTP session timeout of 30 minutes, the session stored in the backed will expire after 35 minutes of inactivity +vaadin.kubernetes.backend-session-expiration-tolerance: 5m +---- + +.application.yaml +[source,yaml] +---- +vaadin: + kubernetes: + backend-session-expiration-tolerance: 5m +---- + +.Java +[source,java] +---- +@Bean +SessionExpirationPolicy sessionExpirationPolicy() { + return sessionTimeout -> Duration.ofMinutes(60); +} +---- +--