Fix user login/logout