Add login and logout functions.