improved error treatment on session timeout