1Setting session timeout globaly. It can be done by implementing ServletContextListener
2@Override
3public void contextInitialized(ServletContextEvent servletContextEvent) {
4 servletContextEvent.getServletContext().setSessionTimeout(timeinminutes);
5}
6
7For specific User we can get the session from Request (HttpServletRequest)
8e.g request.getSession().setMaxInactiveInterval(timeinsecond);