Invalidating session with CDI+JSF not working
问题 I'm trying to implement a logout in my application, so I made this: public String logout(){ try{ FacesContext facesContext = FacesContext.getCurrentInstance(); ExternalContext ex = facesContext .getExternalContext(); ex.invalidateSession(); return "success"; }catch(Exception e){ return "error"; } } But when I check if the user is logged, it says yes: public class AuthenticateListener implements PhaseListener { @Override public void afterPhase(PhaseEvent event) { AuthorizedUser authorized =