Index: lams_central/src/java/org/lamsfoundation/lams/web/SessionListener.java =================================================================== diff -u -r131ce42e64069f574a2a4a9bc1e5c4be4918e5bb -r42c6da4ecec87cbdf2b5a7247abca9c918183b8e --- lams_central/src/java/org/lamsfoundation/lams/web/SessionListener.java (.../SessionListener.java) (revision 131ce42e64069f574a2a4a9bc1e5c4be4918e5bb) +++ lams_central/src/java/org/lamsfoundation/lams/web/SessionListener.java (.../SessionListener.java) (revision 42c6da4ecec87cbdf2b5a7247abca9c918183b8e) @@ -95,12 +95,16 @@ HttpSession session = sessionEvent.getSession(); if (session != null) { SessionManager.removeSessionByID(session.getId(), false); - + UserDTO userDTO = (UserDTO) session.getAttribute(AttributeNames.USER); if (userDTO != null) { String login = userDTO.getLogin(); Principal principal = new SimplePrincipal(login); SessionListener.authenticationManager.flushCache(principal); + + // remove obsolete mappings to session + // the session is either already invalidated or will be very soon by another module + SessionManager.removeSessionByLogin(login, false); } } } Index: lams_central/web/login.jsp =================================================================== diff -u -r131ce42e64069f574a2a4a9bc1e5c4be4918e5bb -r42c6da4ecec87cbdf2b5a7247abca9c918183b8e --- lams_central/web/login.jsp (.../login.jsp) (revision 131ce42e64069f574a2a4a9bc1e5c4be4918e5bb) +++ lams_central/web/login.jsp (.../login.jsp) (revision 42c6da4ecec87cbdf2b5a7247abca9c918183b8e) @@ -176,11 +176,12 @@ // invalidate session so a new user can be logged in HttpSession hs = SessionManager.getSession(); if (hs != null) { - // maybe this attribute removal is not necessary - // since we invalidate the session right after it - hs.removeAttribute("login"); - hs.removeAttribute("password"); - hs.invalidate(); + UserDTO userDTO = (UserDTO) hs.getAttribute("user"); + if (userDTO != null) { + // remove session from mapping + SessionManager.removeSessionByLogin(userDTO.getLogin(), false); + } + hs.invalidate(); } %>