core: do not try to logon from the session if there is no session. Issue #816