Add loginlogout functionality