Hello, I have created a Dash app that has two Dropdowns, one for a stock and two for a market index and creates a graph comparing the two over a period of time. In my code I define a last_graph variable so the screen doesn’t clear back to nothing in case the user enters back-space in both of the edit boxes.
On on a browser on my development machine I can open the page within any number of tabs and create unique graphs on each one. When I open another tab, it starts blank. When I connect to this instance from different machines on my home network, each independent instance works fine and starts fresh. I have deployed this app on to an AWS instance. I can connect to it and create a graph. However, when I connect to it again on another tab or completely different machine, it doesn’t start fresh but displays the last_graph image created from the most recent session, even when it’s a completely different machine. When I select a Stock or Index via the Dropdown, it starts fresh from there and draws just one line (versus also graphing the stock or index value from the prior session).
Can anyone describe why i am experiencing different behavior between my internal and external deployments? Home is OSX and AWS is Linux, could that be the cause? I suspect this has to do with “your callbacks should never mutate variables outside of their scope”. What I can do so that each new connecting instance completely clears itself or if there’s a better way I should be storing last_graph?
Is there a suggested way to get a unique session id? I implemented the suggestion from https://stackoverflow.com/questions/58610254/unique-session-id-for-different-dash-sessions and the session id is reset each time the app is restarted and common between multiple browser sessions.