title: Session management in JSF 2.0
body: <p>I am confused about how sessions are managed in JSF 2.0.</p>
  
  <p>I created 4 pages with login, data, info and sessionexpires that shows once session has expired.</p>
  
  <p>When I click on logout button, it invalidates session by calling the following action method:</p>
  
  <pre><code>public String logout(){
      FacesContext.getCurrentInstance().getExternalContext().invalidateSession();
      return "logout?faces-redirect=true";
  }
  </code></pre>
  
  <p>The code redirects me to logout page, as expected, but when I click browser's back button it takes me to the data page and shows all info, but i think, if session has already expired then it should show sessionexpires page.</p>
  
  <p>How can I achieve the desired functionality?</p>