Retaining a generated element on a multipage app

I have a three-page app. On page one, a user logs in, and the user’s data is pulled from a database to generate a row of cards with text and indicators

here is the callback:

@app.callback(
    Output('user_cards_welcome', 'children'),
    Input('profile_info','data')

)

def user_cards_row(user_data):
    from user_cards import get_user_cards
    if user_data:
        return get_user_cards(user_data)
    else:
        return get_user_cards(user_data=None)

once I go to a different page and come back, the cards are gone. My understanding that the function is triggered by the change in the dcc.Store which only happens once the user logs in but how do I keep the cards there regardless of where a user navigates to? The storage on the dcc.Store is “session”. Or should I change my callback to get triggered by something else?

Thank you!

I ended up changing the callback to

def user_cards_row(user_data, pathname):
    if pathname == '/welcome'or '/':
        from user_cards import get_user_cards
        if user_data:
            return get_user_cards(user_data)
        else:
            return get_user_cards(user_data=None)

but that makes the app generate the cards every time the user comes back to this page, which is not ideal since there is a half-second lag