Saving and Restoring client widget settings for multiple users in Voila Notebook Application

I recently discovered the Voila package that allows for simple conversion of a Jupyer notebook into an application that can be used by multiple simultaneous users. My group of users is small, typically < 10 and sometimes only 1 or 2, but as new apps are developed and deployed I thought about the topic of allowing a user who connects to a Voila app to be able to have the ipywidget controls restored to the values that the user had in the last execution of the app so they can “continue” their work of exploration of data where they left off. I had hoped to find some means of determining the IP address of the client and using that as a key to a python diction maintained by the app of users based on their IP addresses and with a dictionary of settings for their app. The keys in dictionary might be a combination of the IP address and the application name so that a central dictionary could be maintained. This could even be handled by a separate process to serialize access to the settings dictionary. But all of this depends on begin able to gather some specific information about the current session. I would appreciate any ideas that could be put forward to provide a mechanism to accomplish this goal. Currently the applications are hosted on a single host system with a single voila server. I have tried to avoid multi-user approaches like http://tljh.jupyter.org/en/latest/ but found that solution difficult to maintain but I’m open to ideas of other approaches.

I bumped into this sort of problem just last week using panel instead of voila. I then pushed the app up to heroku which was easy enough. At that point, I discovered that things got a little surprising.

Developing for an app in Jupyter(/Lab) is one thing. It has essentially a single client, although you could be running different apps against different kernels.

Pushing it out to a server is a whole new ball game, I think. Your idea of saving ip address and app as a key really won’t work. You need some sort of session management. Nothing would prevent a user from running your app in two separate browser tabs or windows.

If there is some sort of session/state managment, I have not found it yet. That said, this is new to me so I hope some answers will come in.