Implements logout button functionality