Added login, logout, and registration functionality.