Fix bug in session timeout in legacy search.