I’m having trouble on the correct way to implement this. What i want to do is the guest user can fill in the form but before the form can be submitted they have to either log in or register. What is the best way to do this?
- Have the user log in before having access to the form?
- Have the user be able to fill in the form but can’t submit unless logged in or registered?
I prefer the second way because the user has a reason to register after they have gone to the trouble of contributing. Shall i store the form data in a session or cookie? When the user activates the account then the form should submit. What is the correct approach of doing this.
Store the form data (together with the form location) in a session, then redirect him to the register/login page. After the successful login, check if there is saved form data and complete his action.