Logout at close if the user logged in
Merge remote-tracking branch 'chiiph/bug/always_logout' into develop