title: Redirect handling PrimeFaces Ajax requests on session timeout in Spring Security
body: <p>I am trying to get the JSF web front-end to redirect to back to the login page (in Spring Security) when the session times-out.</p>
  
  <p>I have tried using a meta-refresh approach, however this causes an undesired side-effect that the meta-refresh time will not be updated when only AJAX controls are used on the page.  This means that the page may refresh while you are still using it, because you haven't transitioned to another page and only made AJAX calls to the server.  I have not found a way to change this behavior easily using Primefaces.</p>
  
  <p>The Spring Security sends a 302 HTTP error message back to Primefaces when the session has expired, however Primefaces just ignores redirect request.  You can tell when the session has expired as the Primefaces controls stop responding as their AJAX calls are not succeeding.</p>
  
  <p>I have am using Primefaces 3.4.2, and Spring Security 3.1.4 running on Glassfish 3.1.2.2.</p>