Use a flash session, see documentation and tweak as needed. In other words make a session for that, and delete the keys afterwards.
Short term session
Hey team.
Today I want to be able to set a session that is only available on a single request.
A quick rundown of what this part of the app does; We have a client The client has a fact find The fact find has 5 different models with different information.
We need to run versions on this data, so if the data is more than an hour old, we assume it is a new version. To create the new version we duplicate the fact find data, then the fact find, and then finally the client.
The front end form has a page for each of the different categories for the fact find. Currently the front end will send the id of the existing version of the fact find category data to the server. What I need to do is check if the client needs to be duplicated, if it does, duplicate the data and then take the form request data and update that category data with the new user data.
The issue here is we have a different id as the form request will send the old id and the database will have the new id.
So what I am thinking is when I duplicate the data, I store the new id against the old id in a lookup table. Then before I save the form data against the new category data, I swap out the form data ids with the new ones.
So what I would like is to store the lookup in a session, but have it only available on that single request. I don't want any of the other session's to be effected by the short termness of this session. I would prefer not to have to clear the session after the request, but if that is the only way, then I will do that.
I hope that makes sense
Please or to participate in this conversation.