aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjcardus <asklocation.net@gmail.com>2021-07-06 18:29:36 +0100
committerjcardus <asklocation.net@gmail.com>2021-07-06 18:29:36 +0100
commitcd6b59c61f1c9319fe09b0ab1b8b3e39f5a1df62 (patch)
treef1ff46a66a91dfb4d6ffb8452b47c7984412e63d
parent20f3d5f01fdc1088f2069869c61dd9da525a7c22 (diff)
downloadtrackermap-server-cd6b59c61f1c9319fe09b0ab1b8b3e39f5a1df62.tar.gz
trackermap-server-cd6b59c61f1c9319fe09b0ab1b8b3e39f5a1df62.tar.bz2
trackermap-server-cd6b59c61f1c9319fe09b0ab1b8b3e39f5a1df62.zip
use default session handler
-rw-r--r--src/main/java/org/traccar/web/WebServer.java9
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);