Custom Session Property Change From Script

Hello,

I would like to create and/or update my project’s custom session properties through either a component event script or through the session message handler script. Currently when a project is created, the custom session properties are manually entered in the designer on the perspective configuration page. I would however like to have the session properties created and/or update through a script. At the moment I have tried in both the Session Message Handler script and a view component event script.

The code for the message handler looks like this:

and the component script code looks very similar. From my log message I can see that the session properties do change (session.custom) or self.session.custom within the component script. However, if I go back to my project in the designer, the same original custom session properties and their corresponding values are still there.

How can I change these custom session properties in a script so that the change is also reflected in the project/designer?

Thank you.

sessions props are only in THAT session. The ones you create in the designer are loaded into each session as the session is created. But a session can’t change the projects “designed” session props.

1 Like

Saving that data in memory tags would be a better place for it. A user session as well as the designer can write to and read from tags, the changes reflect across all sessions, and the changes persist across sessions. If you have a ton of views already referencing some session props and don't want to redo that, you could even bind the existing session props to the tags so that they can still be read in the same way.