Store large data or a service connection per Flask session
问题 I'm writing a small Flask application and am having it connect to Rserve using pyRserve. I want every session to initiate and then maintain its own Rserve connection. Something like this: session['my_connection'] = pyRserve.connect() doesn't work because the connection object is not JSON serializable. On the other hand, something like this: flask.g.my_connection = pyRserve.connect() doesn't work because it does not persist between requests. To add to the difficulty, it doesn't seem as though