I have a C# MVC application that relies heavily on Ajax. I am using the Ext JavaScript framework but that's not important here.
If a logged on user is on a page and their session times out I need to inform the user this has happened at their very next Ajax request.
For example there is a combo box that does an auto search and displays results. If the session times out and they enter information into this box an Ajax request is posted to the server. Before the action is executed I want to determine that they are not logged in and return a message inside a JSON object detailing the reason for the failure so that I can create a pop up or redirect.
For bonus points it would be easier if I don't have to implement this solution in the 300 or so Actions that I have. An attribute on the class or method would be a good solution and inline with what I currently do for non Ajax 'GET' requests.