auto login and logout added