Created login and logout functionality