Get user name from session

I am trying to find out the user name from session who has updated or published a particular node.
But when i do session.getUserId() i always get a default user name but not the user name who actually initiated that event.
Is there a possibility to find out the “real” user through session or any other different way?

If you have the node path, you can get it from document itself…(hippostd:holder property)

hippostd:holder property tells me who edited or modified the document directly, but this does not work in channel manager.
When i try to edit the document and save or publish it via channel manager it always has the default user name in the hippostd:holder too.
Is there a way to find the user name if i made changes through channel manager? Please advise!

Hi,
Looks like you want hippostdpubwf:lastModifiedBy rather then the hippo:holder!
Cheers, Jeroen

The hippostdpubwf:lastModifiedBy has the right username if the document was edited directly . But if the document is edited via Channel manager it always has the default username no matter who edited it.

Hmm, it shouldn’t work like that. Can you reproduce that in a plain vanilla (archetype) project of your version? I can’t reproduce that in our 13.1 online demo at https://cms.demo.onehippo.com