Protect against sessions with invalid identifiers.