Skip to content

Commit 0f5e706

Browse files
committed
client: explicitly create a session handler to set session timeout
1 parent 2394fda commit 0f5e706

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

client/src/main/java/org/apache/cloudstack/ServerDaemon.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import org.eclipse.jetty.server.handler.MovedContextHandler;
4141
import org.eclipse.jetty.server.handler.RequestLogHandler;
4242
import org.eclipse.jetty.server.handler.gzip.GzipHandler;
43+
import org.eclipse.jetty.server.session.SessionHandler;
4344
import org.eclipse.jetty.util.ssl.SslContextFactory;
4445
import org.eclipse.jetty.util.thread.QueuedThreadPool;
4546
import org.eclipse.jetty.util.thread.ScheduledExecutorScheduler;
@@ -240,7 +241,10 @@ private HandlerCollection createHandlers() {
240241
final WebAppContext webApp = new WebAppContext();
241242
webApp.setContextPath(contextPath);
242243
webApp.setInitParameter("org.eclipse.jetty.servlet.Default.dirAllowed", "false");
243-
webApp.getSessionHandler().setMaxInactiveInterval(sessionTimeout * 60);
244+
245+
final SessionHandler sessionHandler = new SessionHandler();
246+
sessionHandler.setMaxInactiveInterval(sessionTimeout * 60);
247+
webApp.setSessionHandler(sessionHandler);
244248

245249
// GZIP handler
246250
final GzipHandler gzipHandler = new GzipHandler();

0 commit comments

Comments
 (0)