make the session timeout of zk configurable
Description
Environment
Attachments
- 31 Jul 2014, 11:24 AM
Activity
Carlos Ruiz August 2, 2017 at 7:00 PM
Thomas Bayen August 10, 2014 at 7:21 PM
Just for the documentation:
The standard timeout (before this patch) was set in org.adempiere.ui.zk/WEB-INF/web.xml. The value there (60 minutes) is still used as the default if the new sysconfig value is not set.
Carlos Ruiz July 31, 2014 at 3:32 PM
The patch adds a sysconfig variable (configurable per system, client or even organization) named ZK_SESSION_TIMEOUT_IN_SECONDS.
For special rules I tested this code in a login validator and it worked fine:
public String login (int AD_Org_ID, int AD_Role_ID, int AD_User_ID)
{
Session currSess = Executions.getCurrent().getDesktop().getSession();
HttpSession httpSess = (HttpSession) currSess.getNativeSession();
if (AD_User_ID == 100)
httpSess.setMaxInactiveInterval(-1); // SuperUser is immortal
return null;
} // login
Thomas Bayen July 31, 2014 at 3:12 PM
Hi Hiep! We talked about your improvement idea. Great input for our discussion! In my usecase I would say that a timeout may belong to a special workplace (known by the ip address) but there are also reasons to stick it to a user or even a role. The best solution has to be based on several different rules. Because this has worth only for some special cases and most users will not need all these rules it would be best to do this not in trunk.
We can set a good default value (with Carlos patch). Any implementor can create a plugin with a LoginValidator that has some special rules. Carlos patch can be used as an example how to set the timeout value.
Carlos Ruiz July 31, 2014 at 11:24 AM
Attaching a possible patch that allows configurable timeout per tenant.
The session timeout of zk is at a fixed value of 60 Minutes. I like to be able to change that.
My usecase is that I want to have the iDempiere window open the whole working day even if I do not do real work the whole time. But my windows should remain as they are for some hours. I would like to set the session timeout to 8 or 10 hours.
If we do that we should also document how to this in a cloud environment with proxys like nginx or apache. It may need additional configuration to the proxy.