Index: lams_central/src/java/org/lamsfoundation/lams/web/SessionListener.java =================================================================== diff -u -rac1774a2e7f4b8ce9b79e6447b1b4748f719bc32 -r131ce42e64069f574a2a4a9bc1e5c4be4918e5bb --- lams_central/src/java/org/lamsfoundation/lams/web/SessionListener.java (.../SessionListener.java) (revision ac1774a2e7f4b8ce9b79e6447b1b4748f719bc32) +++ lams_central/src/java/org/lamsfoundation/lams/web/SessionListener.java (.../SessionListener.java) (revision 131ce42e64069f574a2a4a9bc1e5c4be4918e5bb) @@ -35,7 +35,6 @@ import org.apache.log4j.Logger; import org.jboss.security.CacheableManager; -import org.lamsfoundation.lams.integration.security.SsoHandler; import org.lamsfoundation.lams.security.SimplePrincipal; import org.lamsfoundation.lams.usermanagement.dto.UserDTO; import org.lamsfoundation.lams.util.Configuration; @@ -95,23 +94,13 @@ // clear the authentication cache when the session is invalidated HttpSession session = sessionEvent.getSession(); if (session != null) { + SessionManager.removeSessionByID(session.getId(), false); + UserDTO userDTO = (UserDTO) session.getAttribute(AttributeNames.USER); - if (userDTO == null) { - SessionManager.removeSessionByID(session.getId(), false); - } else { - // this is set in SsoHandler - // if user logs in from another browser, cache must not be flushed, - // otherwise current authentication process fails - Boolean noFlush = (Boolean) session.getAttribute(SsoHandler.NO_FLUSH_FLAG); - if (!Boolean.TRUE.equals(noFlush)) { - 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); - } + if (userDTO != null) { + String login = userDTO.getLogin(); + Principal principal = new SimplePrincipal(login); + SessionListener.authenticationManager.flushCache(principal); } } } Index: lams_central/web/login.jsp =================================================================== diff -u -r4583983b64efe1d91fbb47cdde6a759a6a30e859 -r131ce42e64069f574a2a4a9bc1e5c4be4918e5bb --- lams_central/web/login.jsp (.../login.jsp) (revision 4583983b64efe1d91fbb47cdde6a759a6a30e859) +++ lams_central/web/login.jsp (.../login.jsp) (revision 131ce42e64069f574a2a4a9bc1e5c4be4918e5bb) @@ -176,12 +176,11 @@ // 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"); - UserDTO userDTO = (UserDTO) hs.getAttribute("user"); - if (userDTO != null) { - SessionManager.removeSessionByLogin(userDTO.getLogin(), true); - } + hs.invalidate(); } %>