[PATCH 1/2] Fix invalid session ID check