title: check if user session has expired asp web api
body: <p>I am experimenting in developing Single Page Application using Asp Mvc 4 / Web Api and angularjs.</p>
  
  <p>I am using the mvc controller actions to return views and web api actions to return json.</p>
  
  <p>As the web api part is restfull and it has no state, I am wondering how to check if a user session has expired. For example: a user is clicking on a button and this leads to request to the web api action to get some json data. But when the request hits the server I want to check if the user session has expired.</p>
  
  <p>As I said I am rather new to this combination of technologies and I am wondering how can this be achieved. Any example will be greatly appreciated. Thanks in advance.</p>