Fix regression detecting expired sessions