aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/traccar/api/resource/UserResource.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/api/resource/UserResource.java b/src/main/java/org/traccar/api/resource/UserResource.java
index 587be014b..d73e8b6f5 100644
--- a/src/main/java/org/traccar/api/resource/UserResource.java
+++ b/src/main/java/org/traccar/api/resource/UserResource.java
@@ -122,7 +122,9 @@ public class UserResource extends BaseObjectResource<User> {
@DELETE
public Response remove(@PathParam("id") long id) throws StorageException {
Response response = super.remove(id);
- request.getSession().removeAttribute(SessionResource.USER_ID_KEY);
+ if (getUserId() == id) {
+ request.getSession().removeAttribute(SessionResource.USER_ID_KEY);
+ }
return response;
}