If logid is not available fallback to calling 'shutdown' directly

The session will be closed anyway, regardless of the user permission
to call shutdown.