Hi, there was a misunderstanding.
When I suggested "you should instead just throw a ConflictingSessionException" and "At this stage, you shouldn't do anything else and leave the "sessions" and "userinfo" maps unchanged" I meant something like this:

assert (! sessions.containsKey(sessionID));
if (userinfo.containsKey(user)) {
throw new ConflictingSessionException(-8, "Previous session termination", null, userinfo.get(user));
} else {
userinfo.put(user, sessionID);
sessions.put(sessionID, sessionInfo);
}

Then you should rely on the Server to call notifySessionClose and a new notifyNewSession to your Adapter.

Also ensure that your implementation of notifySessionClose undoes exactly all that was done in notifyNewSession, which means removing the session line from both the "userinfo" and the "sessions" Map.