Look at  the Accept header in addition to the unreliable 'X-Requested-With' header when deciding whether or not to redirect after logout