Added Login/Logout Handling