add login and logout control