login and logout works properly