Remove inherited thread local from RAP
[lgpl/argeo-commons.git] / security / plugins / org.argeo.security.ui.rap / src / main / java / org / argeo / security / ui / rap / SecureEntryPoint.java
index 10dced4b3e44be80502c4750277988b424025a23..2339716874598d0d142b9431ba91e7a45afbdc8f 100644 (file)
@@ -140,7 +140,7 @@ public class SecureEntryPoint implements IEntryPoint {
                                        return new Integer(result);
                                }
                        });
-                       logout(loginContext, username);
+                       //logout(loginContext, username);
                } finally {
                        display.dispose();
                }
@@ -194,6 +194,11 @@ public class SecureEntryPoint implements IEntryPoint {
 
        protected void logout(ILoginContext secureContext, String username) {
                try {
+                       HttpServletRequest httpRequest = RWT.getRequest();
+                       HttpSession httpSession = httpRequest.getSession();
+                       httpSession.setAttribute(SPRING_SECURITY_CONTEXT_KEY, null);
+                       RWT.getRequest().getSession().setMaxInactiveInterval(1);
+                       SecurityContextHolder.clearContext();
                        secureContext.logout();
                        log.info("Logged out " + (username != null ? username : "")
                                        + " (THREAD=" + Thread.currentThread().getId() + ")");