I have a requirement within the same web application to set 2 session timeouts.
60 minutes for regular users and 3 hours for admin users.
I am told this is not possible and I will need to host a separate web app for the admins.
Is there any workaround?
UPDATE: Thanks to Bozho and Kurt's replies - I have a followup question.
Does session.setMaxInactiveInterval() override the value of session timeout set via web.xml ?
Setting Session timeout − You can call the public void setMaxInactiveInterval(int interval) method to set the timeout for a session individually. Log the user out − The servers that support servlets 2.4, you can call logout to log the client out of the Web server and invalidate all sessions belonging to all the users.
Click Servers > Server Type > WebSphere Application Servers > WebSphere Portal. Click Container Settings > Session management > Set Timeout. Enter the desired timeout value in minutes.
Session timeout represents the event occuring when a user does not perform any action on a web site during an interval (defined by a web server). The event, on the server side, changes the status of the user session to 'invalid' (ie.
You can try session.setMaxInactiveInterval(int interval)
When I look at the HttpSession
interface, I see the following method.
setMaxInactiveInterval(int interval)
: Specifies the time, in seconds, between client requests before the servlet container will invalidate this session.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With