I'm developing my first major web app project with Python+Flask, and looking for advice re best practice for planning the basic level architecture.
I'm not inclined to reinvent the wheel, so I'm about to use Flask-login for handling the login management, and basic Flask sessions for the most basic level session variables like user id and custom session id.
By default, the Flask sessions are cookie based and basically persist only at the client side. However, there will be need for some session variables that will be regularly read (ie, user permissions, custom application config) and I feel awkward to carry all that info around in a cookie, at every single page request and response.
Since the session can be identified at the server side by introducing unique session id at login, some server-side session variable management could be used. Reading this data at the server side from the database also feels like unnecessary overhead.
So, my question is, what is the most efficient way how to handle the session variables at the server side? Perhaps that could be a memory-based solution, but I am worried that different Flask app requests could be executed at different threads that would not share the memory-stored session data, or cause conflicts in case of simultaneous reading-writing.