Added ability to login and logout.