def logout(session):
    """Logout

    If the user has a teamID in the session it is removed and success:1 is returned.
    If teamID is not in session success:0 is returned.
    """

    if 'tid' in session:
        session.clear()
        return {"success": 1, "message": "Successfully logged out."}
    else:
        return {"success": 0, "message": "You do not appear to be logged in."}