My command button only logs out the user on a secondt click, is there a reason? I am using tomcat 6 as follows:
jsf... <h:commandButton rendered="#{request.userPrincipal!=null}" action="#{logoutForm.logout}" value="#{uOptMsg.logOut}"></h:commandButton> and in my backing bean ... public String logout() throws IOException, ServletException { ExternalContext ectx = FacesContext.getCurrentInstance().getExternalContext(); HttpServletRequest request = (HttpServletRequest)ectx.getRequest(); HttpServletResponse response = (HttpServletResponse)ectx.getResponse(); request.getSession(false).invalidate(); return "home"; } is there another wway to invalidate the session created by tomcat to represesnt a logged in user?