diff options
author | jcardus <asklocation.net@gmail.com> | 2021-07-06 18:29:36 +0100 |
---|---|---|
committer | jcardus <asklocation.net@gmail.com> | 2021-07-06 18:29:36 +0100 |
commit | cd6b59c61f1c9319fe09b0ab1b8b3e39f5a1df62 (patch) | |
tree | f1ff46a66a91dfb4d6ffb8452b47c7984412e63d /src/main/java/org/traccar | |
parent | 20f3d5f01fdc1088f2069869c61dd9da525a7c22 (diff) | |
download | traccar-server-cd6b59c61f1c9319fe09b0ab1b8b3e39f5a1df62.tar.gz traccar-server-cd6b59c61f1c9319fe09b0ab1b8b3e39f5a1df62.tar.bz2 traccar-server-cd6b59c61f1c9319fe09b0ab1b8b3e39f5a1df62.zip |
use default session handler
Diffstat (limited to 'src/main/java/org/traccar')
-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); |