diff options
-rw-r--r-- | src/org/traccar/web/server/model/DataServiceImpl.java | 6 | ||||
-rw-r--r-- | war/WEB-INF/web.xml | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/org/traccar/web/server/model/DataServiceImpl.java b/src/org/traccar/web/server/model/DataServiceImpl.java index eb466694..c2ebce15 100644 --- a/src/org/traccar/web/server/model/DataServiceImpl.java +++ b/src/org/traccar/web/server/model/DataServiceImpl.java @@ -108,7 +108,11 @@ public class DataServiceImpl extends RemoteServiceServlet implements DataService private User getSessionUser() { HttpSession session = getThreadLocalRequest().getSession(); - return (User) session.getAttribute(ATTRIBUTE_USER); + User user = (User) session.getAttribute(ATTRIBUTE_USER); + if (user == null) { + throw new IllegalStateException(); + } + return user; } @Override diff --git a/war/WEB-INF/web.xml b/war/WEB-INF/web.xml index 387c1efe..5cd9b715 100644 --- a/war/WEB-INF/web.xml +++ b/war/WEB-INF/web.xml @@ -18,5 +18,9 @@ <welcome-file-list> <welcome-file>traccar.html</welcome-file> </welcome-file-list> + + <session-config> + <session-timeout>0</session-timeout> + </session-config> </web-app> |