function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
rickynrickyn 

How to retain submitted form data through the authentication process?

I have a form on a sites page that guest users fill out. However submitting form requires authentication, so I'm trying to figure out how to retain the user's submitted form data  through the authentication/registration process, and then post it.  The main goal is to allow the user to authenticate only when needed.

 

The flow would go something like this:

1. User goes to the form page.
2. User fills out the form and presses the Submit button.
3. If the user is not logged in, they are prompted to login or
register.
4. User logs in/registers using standard authentication
5. Once logged in/registered, the form data from Step 2 gets submitted and are redericted to a summary page of their submission

 

I'm not sure how to approach this.

A) I have had thoughts of adding the sitelogin and siteregister controller as extensions to my controller to see if that state gets stored, however concerned about a growing view state on my page.

B) I thougfht about cookies to store the form values, however concerned that cookies may be disabled by the user.  Another challenge is that my form is generated by dynamic visualforce components so the form questions and answers will be different for every session.

 

It seems like this is a problem that a lot people would have solved before.

Any pointers on a best practice for this?

CvaCva

Hi Rickyn

     Did you manage to find  a solution for this problem?  I am also looking for the same solution.  Please let me know if there is any approach.

 

Thanks

rickynrickyn
I didn't exactly get a solution to my problem, I adjusted my flow to capture form information after autentication.