DOCUMENTATION

  • Developer
Search »

clearFormSessions()

This function should always be called on the final "thankyou" page of your form. The two functions, initFormPage() and processFormSubmission() store various values in sessions (a built-in PHP temporary storage mechanism) while the user progresses through your form. This function clears them.

Note: you must include the following line before calling clearFormSessions() otherwise your sessions may not be cleared:

Why is this needed?

If the sessions aren't emptied, the user may not be able to put through a second form submission. The reason for this is that when they return to the form, the API functions may well load the old submission ID from the previous submission. Then, when it comes to updating the submission information, it will realize that the submission has already been finalized by the original form submission - and fail!

Usage

The function is generally called without any parameters. It has no return value.

If you originally passed a custom sessions namespace string to the initFormPage() function, you need to pass the same namespace string to this function. For example, if your namespace was "my_form", you'd call this function like so: