not sure which ajax framework you are using, but most (including asp.net ajax) handles server exceptions by letting you specify onError function.
Namespace.Object.Method( var1, var2, onSuccess, onError ) { .. } etc..
if you let asp.net manage sessions, and as long as page in question is enabled for authenticated users only, the framework will throw invalid session exception when it has expired (i forget which exactly)
inside onError you can check for exception type, and re-direct to login page. in fact, all you have to do is reload current page and .net will redirect it to login page for you. document.location.href = document.location.href; (this will reload current page ignoring submitted form data if any)