Displaying logged-in user in header

Have you confirmed that the beforeRender function is actually being called? There are various scenarios which might be preventing that, and troubleshooting those is very different from troubleshooting why the set doesn’t appear to work.