Fixes #94 - handle session errors in both ajax and standard requests.