It has been a long time since I used CF, probably 5 years. I remember a lot but it seems I'm forgetting something.
I have a form that accepts user data. This data gets posted and another form comes up. Prior to the CFQUERY in the in the post, I set a session variable, just before the cflocation that brings the next form.
If I take out the scflocation, I can output the session variable.
But when the 2nd form comes up, the same session variable is undefined.
Any suggestions?
Thanks.
This topic has been closed for replies.
Correct answer BKBK
Page 1 is a form that accepts user data. I use email address as a key, so I pass I store it as session.email
Page 2 includes this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<cfif form.faction eq "sub1">
<cfset zip3 = left(form.zip,3)>
<cfset session.email = form.email>
<CFQUERY NAME="xxx"
DATASOURCE="xxx">
INSERT INTO merchant_master (email, status, company, contact, title, address1, address2, city, state,
Suggestion number 1. Read the source code in the file with the next form. See if there is anything that clears the session.
Suggestion number 2. See if the file with the next form is part of the same application as the one where you set your session variable. If it's in a different one, check that Application.cfc file to ensure it allows session variables.
Your understanding is correct. However, your OP left an element of doubt regarding whether both files were governed by the same application.
To troubleshoot further, cfdump your session scope right before the cflocation tag, and then again at the very start of that other file. That may yield more clues.