I know that there are similar dicussion on the forum, but I wasn’t able to find specific answers to the problem below:
I have a DB schema made of a parent table USERS (with general information about users) and some child tables with specific information (let’s call them USERS_A, USERS_B, etc…). The child tables are linked to the parent table trough a foreign key.
Now, I want to implement a registration form for type A users.
My idea is to implement a form made of 2 steps where in the first step it asks basic information (to be inserted in table USERS) and in step 2 specific information for type A to be inserted in table USERS_A.
I want the two records to be inserted in a single transaction, even the data collected in two steps.
I thought to record the info from the first step of the form inside session using Stateful form, then collect the 2nd step and, finally, insert both records in the DB.
Is this process correct? Is there any problem saving the username and password in session until the other data are collected?
Or maybe, is there any other best practice to do so?
Thanks for the support,