working login&logout