The timeout is configured on the servlet container. There should be two ways to extend the value:
- Add a <session-timeout> element to your web.xml (How to configure the session timeout in servlet – Mkyong.com)
- In the standalone.xml, add a "default-session-timeout" attribute to the <servlet-container> element of the undertow subsystem.
In both cases, the value is specified in seconds. The first option will configure the timeout for that deployment only. The second option would be a global change, and would be across all deployments. If both options are used, the value in specified in the web.xml will apply for that deployment, and the global value will apply to all others.
Edit: The above suggestions may not work for websockets. You may also try to add a "maxIdleTime" init parameter to the servlet that utilizes the websockets. Unlike the other parameters above, this one is specified in milliseconds.
Edit 2: I looked at github to see how the WebsocketServlet is implemented within Undertow, both in master and the 1.4.x branch. The only init-param that is retrieved is "io.undertow.handler". There's a comment immediately after that which indicates that other init parameters still need to be handled. The code is invoking init on HttpServlet, but I doubt the base class does anything with websocket parameters.
I'm sorry for the several edits to this reply. I thought I had a potential answer each time, but I'm out of ideas.
Thanks Greg for the effort, from my understanding, web.xml session-timeout is about the whole session, by default 30 minutes.
Websocket "sessions" are much smaller and by default 60 seconds (here I've found a mention about this: undertow/NodeConfig.java at ff4c9cf37872cb96070ba6a2fcbbaa6df291e390 · undertow-io/undertow · GitHub and also here undertow/Undertow.java at 4734359b69268fd993c36bbfe193d978a9c2a63b · undertow-io/undertow · GitHub )
At least I'm the only found this a little bit strange, I will open an issue on Jira asking for clarification, because seems to be a bug or at least a problem on documentation side