Skip to content

Commit 49af526

Browse files
TatuLundMatthewVaadinmcollovatirusselljtdyerjorgheymans
authored
Document Kubernetes Kit backend session expiration policy (#4144)
* Document Kubernetes Kit backend session expiration policy See: https://github.com/vaadin/kubernetes-kit/pull/163/files * Update articles/tools/kubernetes/configuration.adoc Co-authored-by: Matthew Wilson <[email protected]> * Update configuration.adoc * add Java example * Update articles/tools/kubernetes/configuration.adoc Co-authored-by: Marco Collovati <[email protected]> * Update articles/tools/kubernetes/configuration.adoc Co-authored-by: Marco Collovati <[email protected]> * Edited new text only. * Update articles/tools/kubernetes/configuration.adoc Co-authored-by: Marco Collovati <[email protected]> * Apply suggestions from code review Co-authored-by: Jorg Heymans <[email protected]> * Apply suggestions for example format and clarify differences --------- Co-authored-by: Matthew Wilson <[email protected]> Co-authored-by: Marco Collovati <[email protected]> Co-authored-by: Russell J.T. Dyer <[email protected]> Co-authored-by: Jorg Heymans <[email protected]> Co-authored-by: Matthew Wilson <[email protected]>
1 parent 02dc13c commit 49af526

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

articles/tools/kubernetes/configuration.adoc

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,36 @@ spring:
8484
host: redis-service
8585
----
8686
--
87+
88+
== Backend Session Expiration Policy
89+
90+
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.
91+
92+
[.example]
93+
--
94+
Given an HTTP session timeout of 30 minutes, the session stored in the backend will expire after 35 minutes of inactivity.
95+
[source,properties]
96+
----
97+
<source-info group="application.properties"></source-info>
98+
vaadin.kubernetes.backend-session-expiration-tolerance: 5m
99+
----
100+
101+
Given an HTTP session timeout of 30 minutes, the session stored in the backend will expire after 35 minutes of inactivity.
102+
[source,yaml]
103+
----
104+
<source-info group="application.yaml"></source-info>
105+
vaadin:
106+
kubernetes:
107+
backend-session-expiration-tolerance: 5m
108+
----
109+
110+
The session stored in the backend will expire after 35 minutes of inactivity, regardless of the HTTP session timeout.
111+
[source,java]
112+
----
113+
<source-info group="Java bean"></source-info>
114+
@Bean
115+
SessionExpirationPolicy sessionExpirationPolicy() {
116+
return sessionTimeout -> Duration.ofMinutes(35);
117+
}
118+
----
119+
--

0 commit comments

Comments
 (0)