Flask mixing up authenticated users when running in production mode
The problem is whith Flask when i am trying to add any wsgi server (tried uWSGI and Gunicorn).
When i am running it in developing mode with built-in wsgi server all requests from different pages are handled in different threads and responses are coming straight where they should.
When i am running Flask with any third-party wsgi server in either multithreading/multiprocessing/singlethreading/singleprocessing mode all requests are being handled, but responses could be mixed up. For example on every page refresh i could be logged in as any person already logged in.
Am i suppose to block threads when any requests are handled by it or should i logout user every time server sends a response or should i set up cookies and also add any decorator or middleware which would be triggered on every request and relogin user? I can't understand why it doesn't work as i expect it to work cause i couldn't find any information in web on how wsgi are handling requests after nginx as a reversed proxy.