Hi all,
I am fairly well versed in Cf but by no means an expert.
I am writing an App that requires user registration / payment. I have 5 steps:
1. Choose Member Type
2. Create Account
3. Payment
4. Receipt
5. Member CP
Currently I use #step# as my counter. (have tried both session.step and
cookie.step)
Basically
<cfform action="register.cfm">
+ Hidden inputs to pass vars
register.cfm
<cfif IsDefined('form.step')>
<cfswitch expression="#session.step#">
<cfcase value="step_1">
<cfset template = "/register/step_1.cfm">
</cfcase>
<cfcase value="v_step_1">
<cfset template = "/register/v_step_1.cfm">
</cfcase>
.....
I am using <cflocation> after each step is validated (v_) to prevent browser
refresh and duplicate DB entries.
I am running into difficulties with using session.step and cookie.step
session.step = No expiry and therfore going back creates a problem as the
<cfswitch moves the user automatically back to where they left off. (I also use
sessions to track user login)
cookie.step = not updating before the <cflocation and thus the same step is
repeated over and over
I would like to avoid using url.step
Looking for some suggestions / help / other way of doing it
Cheers
Steve Sommers - 30 May 2007 19:07 GMT
I'm not sure you really need session or cookie step. I use similar logic but
instead use a hidden form field "step". Another trick I use is a hidden form
field "uuid" that is set to a matching value in my session scope. This way, if
they do not agree I reset the entire process to the beginning. This prevents
the "No expiry" problem you mentioned that can sometimes be duplicated with
bookmarks or using the browser history to jump around.