In a multi store environment, there could be a need to modify the session timeout for a particular store in comparison to the rest of the stores. Currently at Websphere application server level , there is an option to configure the session time out to be at 30 minutes which would be applied for all the stores.
Set the session inactive time when the user does a login into that store, through one of the logon commands, where maxTimeOut is set to a value of such as 7200.
After this implementation, the expectation is that users who login into this store will have a session time out after 120 minutes and not the usual 30 minutes,
Below are the high-level steps to customize:
1. Create a new servlet filter (filter that implements the interface) and register it after the runtime filter in the web.xml of the Stores web module.
2. From the filter created in step 1, get the instance of the SessionContext from the command context request attribute and cast it to HttpSessionContext.
3. Use the following API to change the max inactive interval period.
4. If the value returned by getStoreId() is the particular store you want to extended the timeout for, you can use setExpireTime() and change it to the value you require.
Note, if you use super.doFilter(), this will actually invoke the request such that your logic will not be invoked until the very end.
Try to use the chain.doFilter(request, response) at the end of your logic which passes the request to the next step in the processing step.