DOCUMENTATION

  • Developer
Search »

ft_api_clear_form_sessions

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

Note: it appears there may be an issue with this function: you must include the following line before calling ft_api_clear_form_sessions 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 ft_api_init_form_page 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: