I am facing a strange issue and unable to find a way out. I have a web api application which is working fine until it times out. At this point when i make a ajax call server response is empty and an additional response is received with Login URL.

I thought of catching response and read location header to identify if it contains login URL with no success. How should we handle such scenario in web api ajax calls?