Handle logout/login, remove/add all databases.