Fix runtime panics in the case of wrong session id for loginCheck