From 4bfabfcf298cb8a89fbe2cd2b0bb4ee868a85360 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Mon, 8 Dec 2014 11:20:44 -0800 Subject: [PATCH] Ensure Undertow session timeout is set correctly Assume that Undertow uses -1 for "no expiry". See gh-2084 --- .../undertow/UndertowEmbeddedServletContainerFactory.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-boot/src/main/java/org/springframework/boot/context/embedded/undertow/UndertowEmbeddedServletContainerFactory.java b/spring-boot/src/main/java/org/springframework/boot/context/embedded/undertow/UndertowEmbeddedServletContainerFactory.java index c278e74923..3f1032d45a 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/embedded/undertow/UndertowEmbeddedServletContainerFactory.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/embedded/undertow/UndertowEmbeddedServletContainerFactory.java @@ -337,7 +337,8 @@ public class UndertowEmbeddedServletContainerFactory extends DeploymentManager manager = Servlets.defaultContainer().addDeployment(deployment); manager.deploy(); SessionManager sessionManager = manager.getDeployment().getSessionManager(); - sessionManager.setDefaultSessionTimeout(getSessionTimeout()); + int sessionTimeout = (getSessionTimeout() > 0 ? getSessionTimeout() : -1); + sessionManager.setDefaultSessionTimeout(sessionTimeout); return manager; }