Custom ui node: how to get synchronisation between sessions and after page refresh

Finally I found out how to do this with custom ui nodes. If you set the storeFrontEndInputAsState to truethe dashboard does the work for you. It will pass the last state and every new state to all connected clients as normal messages. A little bit tricky (at lest for me) is how to determine if the origin of a message is actual the own message sent by the client to avoid undesired loops. But in the end I found a solution (I think)