Better handling of login/logout/reload