I'm not sure if your ajaxStop callback really is being called, after the ajax call, test it using console.log or simply alert it, like this:
$("#logout").live("click",function(){
$(document).ajaxStop(function(){
alert('ajaxStop callback');
window.location.reload();
});
});
and if it isn't called, it means you have one or multiple ajax requests in the page which are not completed. as you know .ajaxStop()
Register a handler to be called when all Ajax requests have completed
you can check your browser developer tool and look for ongoing xhr requests.
most likely your problem is you add .ajaxStop() trigger after all Ajax requests have completed, then since there is no ongoing ajax call, it will never fire.
the problem is if you use several advanced jQuery or other client frameworks components, it might never happen. I mean advanced components usually always use ajax requests in the background, without you even knowing.
other possible problem could be an ajax request gone through timeout, without being completed.
you have to be careful about the global option, since:
If $.ajax() or $.ajaxSetup() is called with the global option set to false, the .ajaxStop() method will not fire.
for instance if you have an ajax call like this:
$.ajax({
//...
global: false,
// ...
});
or
$.ajaxSetup({
...
global: false,
...
});
$.ajax(...);
your .ajaxStop() method will not fire.