I need to check whether or not a user is logged in or not based on a session. I know there are other ways like setting setInterval, etc to get this data back, but what I'm wondering is there a way to see the data requested back from a ajax request on a global scale such as:
$(document).ajaxStop(function(){ //show data });
I'm wondering this specifically because I have all my ajax calls on the front end being filtered through one method on the server side and in that method, I'm just returning a variable if the session is dead. I'd much rather be able to check that variable from one place rather than have to check it in every method before throwing a session error.
Is this possible or is there a way to retrieve the data through the global request?