✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
⚡️ Concerned about the grid? Kyle Baranko teaches how to predicting peak loads using XGBoost. Register for the August webinar!

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.