I want to store temporary data that can be accessed across multiple http request. The question may be similar to How to persist temporary data over multiple HTTP requests?. The accepted answer is too specific to ASP. However, in my case i'm using rails as the framework. I want to know possible pattern that at least will solve the problem on my environment and use case.
Environtment: Server side:
- Rails 4
- Chrome / Firefox
Use case: Client make a request to create an object on server side, and make the object accessible at least one day in multiple http connection. The data to store is a hash with value of strings, a long strings, that can take up to thousands of characters.
I tried few different approach to accomplish this, for example :
List item Using temporary database object.
I created a column to mark the data as temporary. And i created a worker to delete the temporary data everyday.
The problem with this approach is create alot of temporary data and make the database dirty.
Using cookie as the storage
Cookie is great choice but is it can hold up string with thousands of chars ?
Is there any better approach for me to store temporary data ? The pattern that works in rails will be acceptable, but it will be better if it is general and can be applied to different framework.