Skip to content

Document Kubernetes Kit backend session expiration policy #4144

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
May 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions articles/tools/kubernetes/configuration.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,36 @@
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.

Check warning on line 94 in articles/tools/kubernetes/configuration.adoc

View workflow job for this annotation

GitHub Actions / lint

[vale] reported by reviewdog 🐶 [Vaadin.Will] Avoid using 'will'. Raw Output: {"message": "[Vaadin.Will] Avoid using 'will'.", "location": {"path": "articles/tools/kubernetes/configuration.adoc", "range": {"start": {"line": 94, "column": 80}}}, "severity": "WARNING"}
[source,properties]
----
<source-info group="application.properties"></source-info>
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.

Check warning on line 101 in articles/tools/kubernetes/configuration.adoc

View workflow job for this annotation

GitHub Actions / lint

[vale] reported by reviewdog 🐶 [Vaadin.Will] Avoid using 'will'. Raw Output: {"message": "[Vaadin.Will] Avoid using 'will'.", "location": {"path": "articles/tools/kubernetes/configuration.adoc", "range": {"start": {"line": 101, "column": 80}}}, "severity": "WARNING"}
[source,yaml]
----
<source-info group="application.yaml"></source-info>
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.

Check warning on line 110 in articles/tools/kubernetes/configuration.adoc

View workflow job for this annotation

GitHub Actions / lint

[vale] reported by reviewdog 🐶 [Vaadin.Will] Avoid using 'will'. Raw Output: {"message": "[Vaadin.Will] Avoid using 'will'.", "location": {"path": "articles/tools/kubernetes/configuration.adoc", "range": {"start": {"line": 110, "column": 35}}}, "severity": "WARNING"}
[source,java]
----
<source-info group="Java bean"></source-info>
@Bean
SessionExpirationPolicy sessionExpirationPolicy() {
return sessionTimeout -> Duration.ofMinutes(35);
}
----
--