Flask sessions to maintain client-specific global variables in Dash

I’m building a dash app that allows user to upload files, processes data from those files, and has to store the results (for further functionality). I initially used a global variable to do this - but realized this is a bad idea because it introduces cross-talk between different client sessions (i.e. each client’s page accesses the data uploaded by other clients sessions, whereas in reality the data seen by each client ought to be independent of anything other clients might upload.

I’m hoping to use Flask-Session to accomplish what I need - something along the lines of lhc’s answer to this thread - the third answer on the thread.

At first glance it seems not to work - upon using a variable in the session dict (session[‘client_specific_data’]) to store the data, I still see cross talk between different client sessions.

Could someone tell me if what I am trying to do is possible and whether flask sessions are a way to accomplish it? Can provide code examples if necessary.

Hi rp2532.
Did you ever find a solution to this?

I ended up using hidden Divs in the page to store the data that I needed for further processing. This data was in the form of pickled objects of a class that I defined. I did not end up using client sessions.

Hey rp2532. I am facing the same issue. I want to get the data uploaded from the clients on my dash app and then perform some calculation and show it to them, but should not clash with other client working in the process parallelly.

I am generating a UUID and using that UUID I am creating location for storing the files and access them for the same UUID using state parameter in callbacks. The issue is, I cannot generate a different UUID for the same app running locally on my browser and in incognito.

Any suggestion in this regard will be very useful.

Har you tried the server side output in dash-extensions?

Thank You Emil. I will check this one out. Thank You