how to let guest first post a form, then signup/signin, then associate form object with signed in user?

I have a form for guest to fill in. When guest submits the form, the form data goes to a "create" action which requires signin, guest needs to signin/signup to submits because I need to associate the form object with a registered user. The problem is after the guest signup/signin, and redirect to the "create" action, the form data are gone.

What is the implementation logic for this kind of situation? where we first let guest creating something, then proceed to signin/signup after guest wants to submit it? thanks for your help!

One way is to keep the data in a session… use setState()…

the other way is to have a temporary table for data like that… and to write the data to that table…