Add login and logout function.