I'd like to ask this question to make sure I don't "invent" a way to do something that's best done a different way.
Let's say in a template you want to show the user's display name after login.
In my login snippet, I set the displayname into session.
$_SESSION['displayname'] = $obj->get('displayname');
Option 1: In the template, I can call a snippet that returns the displayname
Option 2: Somewhere (where would I do this?) call
$modx->toPlaceholder('displayname', $_SESSION['displayname'],'wms');
to create a placeholder and then show it in the template with
Or is there some better way to do this? Thanks for any help and best practice advice.