diff options
-rw-r--r-- | src/main/java/org/traccar/web/WebServer.java | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/main/java/org/traccar/web/WebServer.java b/src/main/java/org/traccar/web/WebServer.java index 354e12695..1f6af8b2d 100644 --- a/src/main/java/org/traccar/web/WebServer.java +++ b/src/main/java/org/traccar/web/WebServer.java @@ -26,11 +26,7 @@ import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.handler.ErrorHandler; import org.eclipse.jetty.server.handler.HandlerList; import org.eclipse.jetty.server.handler.gzip.GzipHandler; -import org.eclipse.jetty.server.session.DatabaseAdaptor; -import org.eclipse.jetty.server.session.DefaultSessionCache; -import org.eclipse.jetty.server.session.JDBCSessionDataStoreFactory; -import org.eclipse.jetty.server.session.SessionCache; -import org.eclipse.jetty.server.session.SessionHandler; +import org.eclipse.jetty.server.session.*; import org.eclipse.jetty.servlet.DefaultServlet; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; @@ -184,11 +180,10 @@ public class WebServer { databaseAdaptor.setDatasource(Context.getDataManager().getDataSource()); JDBCSessionDataStoreFactory jdbcSessionDataStoreFactory = new JDBCSessionDataStoreFactory(); jdbcSessionDataStoreFactory.setDatabaseAdaptor(databaseAdaptor); - SessionHandler sessionHandler = new SessionHandler(); + SessionHandler sessionHandler = servletHandler.getSessionHandler(); SessionCache sessionCache = new DefaultSessionCache(sessionHandler); sessionCache.setSessionDataStore(jdbcSessionDataStoreFactory.getSessionDataStore(sessionHandler)); sessionHandler.setSessionCache(sessionCache); - servletHandler.setSessionHandler(sessionHandler); } int sessionTimeout = config.getInteger(Keys.WEB_SESSION_TIMEOUT); |