Fixed handling session timeouts with ajax