title: Logging out from an ajax call
body: <p>Nowadays we tend to split the amount of work made in just one page before this one renders, to speed things up, so, we normally load the basic and then upon DOM is ready, we call all parts to bring more data showing the normal animated loading gif ...</p>
  
  <p><strong>What is the normal procedure</strong> to, when requesting for such method, the user session already expired and he/she needs to login again?</p>
  
  <p>Currently I have no such thing and the browser only shows endless the loading gif... I was wonder what would be the best approach to such trivial problem.</p>
  
  <p>I thought about sending an error flag that, from javascript I could read and redirect to the login page</p>
  
  <pre><code>$.get( url, data, function(data) { 
      if(data.logout) document.location.href = '/LogOut'; 
      ...
  });
  </code></pre>
  
  <p>but I get <strong>nothing</strong> from my controller soon the session expired... </p>
  
  <p>P.S. My web application is made using ASP.NET MVC 3.</p>