Added login/logout functionality