Closed aukeschaap closed 1 year ago
msal's ConfidentialClientApplication is not something that belongs in a session... I'm not surprised that pickling this fails.
It's something you usually instantiate once during application startup, but maybe even creating it on demand is fine (I don't think it performs any network requests or other slow things during instantiation)
Creating it on demand is not desirable, as it does perform network requests during instantiation. Creating it once is also not possible in a model with multiple workers. Hence my attempt to cache it in a server-side session. However, it seems the issue is not due to flask-session, as pickling the class in isolation fails as well. Therefore, consider this closed.
I am running into an issue when I am trying to cache an object in the session. Specifically, I'm trying to do the following:
In a different function I retrieve the object from the session, use/modify it, and store it in the session again.
I get the following errors in my log:
I have not touched
Session
orrequests.sessions.Session
so I'm not sure what has happened to cause this. Do you have any idea?