@app.callback(Output('content', 'children'), [Input('location', 'pathname')])
def on_location(location_path):
    if (location_path is None):
        raise PreventUpdate
    if ('logged-out' in location_path):
        return 'Logged out'
    else:

        @flask.after_this_request
        def _insert_cookie(rep):
            rep.set_cookie('logout-cookie', 'logged-in')
            return rep
        return dcc.LogoutButton(id='logout-btn', logout_url='/_logout')
@app.callback(Output('content', 'children'), [Input('location', 'pathname')])
def on_location(location_path):
    if (location_path is None):
        raise PreventUpdate
    if ('logged-out' in location_path):
        return 'Logged out'
    else:

        @flask.after_this_request
        def _insert_cookie(rep):
            rep.set_cookie('logout-cookie', 'logged-in')
            return rep
        return dcc.LogoutButton(id='logout-btn', logout_url='/_logout')