code function login, logout and change password