When the user becomes inactive, the countdown of the session timeout period starts. The countdown keeps running until the user clicks into the UI including clicking empty space or focusing a field. Once the countdown has lapsed, the session is considered inactive and is destroyed by the respective service, which runs every 5-6 minutes or so.
Session timeout is set in minutes in the <session-timeout>
element in the <YOUR_APP>-vaadin-war/web.xml
project. Set it to -1
to disable it.
<session-config>
<session-timeout>15</session-timeout>
</session-config>
Note on Websphere's LTPA tokens: Authentication on Websphere is done via LTPA tokens, which define their expiration time. The expiration time is not influenced by user activity.
If a session expires while the LTPA token is valid, the user remains logged in: Next time the user accesses the application, they are assigned a new session, but as their LTPA-token cookie is still valid, they are logged in to the application automatically.
You can customize the authentication to the Application User Interface in the AppUIProvider
class: by default, getUIClass()
, that serves the UI, checks whether the user is logged in and if this is not the case, it checks whether the user exists and is active. Adapt the method as required.
To set the page which is loaded after the user has logged in and when they click the logo, modify openHomePage()
of the LspsUI class:
public void openHomePage() {
navigateTo(<VIEW>.ID);
// for example:
// navigateTo(getNavigator().documentsViewId());
}
public void openHomePage() {
openDocument("<FULLY_QUALIFIED_DOCUMENT_NAME>", null);
//for example: openDocument("module::docMainScreen", null);
}
Important: We strongly recommend to use JavaScript sparingly and exclusively *with the aim to change the presentation layer of your application.
To add a JavaScript to your custom application, do the following:
<YOUR_APP>-vaadin-war/src/main/webapp/VAADIN/js/
directory.@com.vaadin.annotations.JavaScript({ "vaadin://js/<YOUR_JS>.js" })
For example: @com.vaadin.annotations.JavaScript({ "vaadin://js/hello.js" })
http://localhost:8080/myproject/VAADIN/js/test.js