I'm creating a Flask application that requires each request to use some data that a user has passed to the application to initialize their session. Once they have passed that data and initialized the session, I'd like to re-use that data over and over until their session is done to fill requests without them having to pass the data for each request.
I can't seem to figure out the best way to do this. Storing it in the session variable doesn't work because that data just gets sent back to the user and then its the same as just passing it every request. Storing the data in a database doesn't seem like the right choice because I need to throw it away at the end of the session, and I don't see any decorator to implement for when a session expires...so I'm afraid my database will just end up filling up with all of these data that come from initialization and no guaranteed way to remove them at the end of a session.
Any suggestions?