Added more safety to UserSession's isAuthenticated()