-
Notifications
You must be signed in to change notification settings - Fork 205
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
Document Kubernetes Kit backend session expiration policy #4144
base: latest
Are you sure you want to change the base?
Conversation
|
||
== Backend Session Expiration Policy | ||
|
||
Backend session expiration policy allows to define an expiration timeout for the backend stored session. By default no expiration is set, but can be expiration can be activated setting the property or by providing a custom SessionExpirationPolicy bean. If no unit is provided in the property, seconds are assumed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By implementing the SessionExpirationPolicy
interface, the developer can define the expiration timeout.
However, the property does not define the timeout value, but the amount of time to be added to the HTTP session timeout to determine the expiration of the backend session. If time unit is not given, milliseconds is assumed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to add also a SessionExpirationPolicy
implementation example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for clarification
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this suffice for code example?
@Bean
SessionExpirationPolicy sessionExpirationPolicy() {
return Duration.ofMinutes(60);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The SessionExpirationPolicy.apply()
method takes current HTTP session timeout as argument
@Bean
SessionExpirationPolicy sessionExpirationPolicy() {
return sessionTimeout -> Duration.ofMinutes(60);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If time unit is not given, milliseconds is assumed.
This may be the default, but it's not particularly useful. If seconds are more appropriate, perhaps the property should be annotated with @DurationUnit(ChronoUnit.SECONDS)
and the original phrasing kept?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sound a good idea
Co-authored-by: Matthew Wilson <[email protected]>
Co-authored-by: Marco Collovati <[email protected]>
Co-authored-by: Marco Collovati <[email protected]>
Co-authored-by: Marco Collovati <[email protected]>
See: https://github.com/vaadin/kubernetes-kit/pull/163/files