Implement session, login, and logout.