How to use Session

omidhz 26 Apr, 2015
Hi,
I'm somehow new to CF and also very begginer in php.
I need to design a large form with a lot of data to be collected from the user. Some of the form elements will depend on the an answer that user gives to another question.
I'm thinking of having multiple small forms and then pass data from one form to another dependin on the answer that the user gives.
Here are my questions:
[list=]1- Is session a good idea, or should I store the data in DB on each step and retrieve the data on the next form? I personally like to use session, so if a user decides to stop and not to complete, I don't fill the data base with a lot of incompelte information.
2- How can I use session do to that? Is there any demo/instructions on how to use sessions?[/list]
GreyHead 27 Apr, 2015
1 Likes
Hi Omidzh,

You can use either several different forms or a multi-page form. The ChronoForms Multi Page action will save the data to the User Session between pages. Note that if the form is complex and requires the user to look for information then you may need to make the user session longer that the default 15 minutes.

Personally I add a status column to the database table and save the data after each page and change the status to complete after the final page submission. This can save problems if the user loses a partly complete form. Database tables will take lots of data without problems but you could always run a cron job every few days to remove any old and incomplete records.

If you are building a 'Wizard' type of form then it may be simpler to use multiple smaller forms and switch between them as needed. The Multi Page action will also work there but you need to enable the Session Key option.

Bob
omidhz 27 Apr, 2015
Thank you for your reply GreyHead,
I decided to use the Multi-form. But how/where can I change the session time?
GreyHead 27 Apr, 2015
Answer
1 Likes
Hi omidhz,

Site Admin | Global Configuration | System | Session Settings

Bob
omidhz 27 Apr, 2015
Thanks,
I thought session time needs to be setup in the form design. 😀
This topic is locked and no more replies can be posted.