aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-04-17 01:29:00 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2016-04-17 01:29:00 +1200
commit00736129e6a7f33cfbd21c5a52a393863d88d8fb (patch)
tree9342c152e6009047a6c95d80b6b3fc3802844c23 /src/org/traccar
parentd0d83fd1424b87fcba295676a0116cc61bf79767 (diff)
downloadtraccar-server-00736129e6a7f33cfbd21c5a52a393863d88d8fb.tar.gz
traccar-server-00736129e6a7f33cfbd21c5a52a393863d88d8fb.tar.bz2
traccar-server-00736129e6a7f33cfbd21c5a52a393863d88d8fb.zip
Option to set server session timeout
Diffstat (limited to 'src/org/traccar')
-rw-r--r--src/org/traccar/web/WebServer.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/org/traccar/web/WebServer.java b/src/org/traccar/web/WebServer.java
index f1a282567..dc933aa00 100644
--- a/src/org/traccar/web/WebServer.java
+++ b/src/org/traccar/web/WebServer.java
@@ -58,7 +58,7 @@ public class WebServer {
private final Config config;
private final DataSource dataSource;
private final HandlerList handlers = new HandlerList();
- private final SessionManager sessionManager = new HashSessionManager();
+ private final SessionManager sessionManager;
private void initServer() {
@@ -75,6 +75,12 @@ public class WebServer {
this.config = config;
this.dataSource = dataSource;
+ sessionManager = new HashSessionManager();
+ int sessionTimeout = config.getInteger("web.sessionTimeout");
+ if (sessionTimeout != 0) {
+ sessionManager.setMaxInactiveInterval(sessionTimeout);
+ }
+
initServer();
initApi();
if (config.getBoolean("web.console")) {