Added login logout functionality.