Add loginout action and associated function