Updating Sessionstate Data from a Subprocess

Hi All -
I have a websocket application that makes an api call based on a selectbox choice that is made on the home page of the app. When that choice is made, I add a “choice” key to my sessionstate object, with the value being the actual choice itself, and then run a subprocess. The subprocess is the websocket on a loop. It exists as a separate python script. The choice that is made on the home page of the app needs to be accessed by this script, but the sessionstate is reset when importing it into that script.

At the moment, I’m hacking my way through it by writing lines onto a temporary txt file. This works, but I’m curious if there’s a way for sessionstate to be read by a subprocess. The more data I can keep within the sessionstate object, the better.

Thank you.

There are other ways of inter-process communication.