session variable blues
Okay I'm a newbie and I'm having some trouble using session variables. They are not being stored it seems and therefore not being passed from template to template as the user moves through the app,. My application file looks like this cfapplication name="whatever" clientmanagement="Yes" sessionmanagement="Yes" setclientcookies="Yes" sessiontimeout="#createtimespan(0,0,20,0)#" applicationtimeout="#createtimespan(1,0,0,0)#" !--params for clientinfo table-- cfparam name="session.lname" default="" cfparam name="session.fname" default="" cfparam name="session.email" default="" cfparam name="session.phone" default="" cfparam name="session.coname" default="" cfparam name="session.title" default="" Then the folowing templates ask for the user to input their names etc. in form fields where they get stired for the duration of the visit. like so; form action="screen2.cfm" method="POST" input type="Text" name="lname" size="25" value="":Last Namebr input type="Text" name="fname" size="25" value="":First Namebr input type="Text" name="email" size="25" value="": Emailbr input type="Text" name="phone" size="25" value="": Phone Numberbr input type="Text" name="coname" size="25" value="": Company Namebr input type="Text" name="title" size="25" value="": Titlebr input type="Submit" value="next" screen2.cfm; cfoutput Hello #session.fname# #session.lname#br Your email address is : #session.email#br /cfoutput etc. But the varibles entered on screen1 are not being passed to screen2.cfm? Now this should be really simle but I must be missing something. Can somebody please help me out. I would be eternally grateful. Thanks spencer the newbie -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: session variable blues
from one newbie to another. Try using #Form.lname# instead of session. Hope this helps (probably won't though) -Original Message- From: Spencer Saunders [mailto:[EMAIL PROTECTED]] Sent: Monday, May 08, 2000 8:12 AM To: cftalk Subject: session variable blues Okay I'm a newbie and I'm having some trouble using session variables. They are not being stored it seems and therefore not being passed from template to template as the user moves through the app,. My application file looks like this cfapplication name="whatever" clientmanagement="Yes" sessionmanagement="Yes" setclientcookies="Yes" sessiontimeout="#createtimespan(0,0,20,0)#" applicationtimeout="#createtimespan(1,0,0,0)#" !--params for clientinfo table-- cfparam name="session.lname" default="" cfparam name="session.fname" default="" cfparam name="session.email" default="" cfparam name="session.phone" default="" cfparam name="session.coname" default="" cfparam name="session.title" default="" Then the folowing templates ask for the user to input their names etc. in form fields where they get stired for the duration of the visit. like so; form action="screen2.cfm" method="POST" input type="Text" name="lname" size="25" value="":Last Namebr input type="Text" name="fname" size="25" value="":First Namebr input type="Text" name="email" size="25" value="": Emailbr input type="Text" name="phone" size="25" value="": Phone Numberbr input type="Text" name="coname" size="25" value="": Company Namebr input type="Text" name="title" size="25" value="": Titlebr input type="Submit" value="next" screen2.cfm; cfoutput Hello #session.fname# #session.lname#br Your email address is : #session.email#br /cfoutput etc. But the varibles entered on screen1 are not being passed to screen2.cfm? Now this should be really simle but I must be missing something. Can somebody please help me out. I would be eternally grateful. Thanks spencer the newbie -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: session variable blues
You need to reference form vaiables passed via POST like this: cfoutput Hello #Form.fname# #Form.lname#br Your email address is : #Form..email#br /cfoutput If you want these to be session variables, you need to set them first: cfset Session.fname = #Form.fname# cfset Session.lname = #Form.lname# etc. Only then can you reference the values you are looking for by 'Session.whatever' .Todd - Original Message - From: "Spencer Saunders" [EMAIL PROTECTED] To: "cftalk" [EMAIL PROTECTED] Sent: Monday, May 08, 2000 11:12 AM Subject: session variable blues | form action="screen2.cfm" method="POST" | input type="Text" name="lname" size="25" value="":Last Namebr | input type="Text" name="fname" size="25" value="":First Namebr | input type="Text" name="email" size="25" value="": Emailbr | input type="Text" name="phone" size="25" value="": Phone Numberbr | input type="Text" name="coname" size="25" value="": Company Namebr | input type="Text" name="title" size="25" value="": Titlebr | | | input type="Submit" value="next" | | | screen2.cfm; | | cfoutput | Hello #session.fname# #session.lname#br | Your email address is : #session.email#br | /cfoutput -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: session variable blues
Is there more code on the "screen2" page that sets the form variables to the session variables? Something like: cfset SESSION.fname = FORM.fname cfset SESSION.lname = FORM.lname OR cfscript SESSION.fname = FORM.fname; SESSION.lname = FORM.lname; /cfscript Otherwise the session variables aren't being set. Sharon At 11:12 AM 5/8/2000 -0400, Spencer Saunders wrote: Okay I'm a newbie and I'm having some trouble using session variables. They are not being stored it seems and therefore not being passed from template to template as the user moves through the app,. My application file looks like this cfapplication name="whatever" clientmanagement="Yes" sessionmanagement="Yes" setclientcookies="Yes" sessiontimeout="#createtimespan(0,0,20,0)#" applicationtimeout="#createtimespan(1,0,0,0)#" !--params for clientinfo table-- cfparam name="session.lname" default="" cfparam name="session.fname" default="" cfparam name="session.email" default="" cfparam name="session.phone" default="" cfparam name="session.coname" default="" cfparam name="session.title" default="" Then the folowing templates ask for the user to input their names etc. in form fields where they get stired for the duration of the visit. like so; form action="screen2.cfm" method="POST" input type="Text" name="lname" size="25" value="":Last Namebr input type="Text" name="fname" size="25" value="":First Namebr input type="Text" name="email" size="25" value="": Emailbr input type="Text" name="phone" size="25" value="": Phone Numberbr input type="Text" name="coname" size="25" value="": Company Namebr input type="Text" name="title" size="25" value="": Titlebr input type="Submit" value="next" screen2.cfm; cfoutput Hello #session.fname# #session.lname#br Your email address is : #session.email#br /cfoutput etc. But the varibles entered on screen1 are not being passed to screen2.cfm? Now this should be really simle but I must be missing something. Can somebody please help me out. I would be eternally grateful. Thanks spencer the newbie --- --- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: session variable blues
if your going to store the form. variables as session variables for this one form then you need to change the attribute for them, a quick albeit dirty way to do it: cfloop list="#form.fieldlist#" index="field" cfset "session["#trim(field)#"] = "#evaluate("form.#trim(field)#")#" /cfloop Fred - Original Message - From: "Spencer Saunders" [EMAIL PROTECTED] To: "cftalk" [EMAIL PROTECTED] Sent: Monday, May 08, 2000 10:12 AM Subject: session variable blues Okay I'm a newbie and I'm having some trouble using session variables. They are not being stored it seems and therefore not being passed from template to template as the user moves through the app,. My application file looks like this cfapplication name="whatever" clientmanagement="Yes" sessionmanagement="Yes" setclientcookies="Yes" sessiontimeout="#createtimespan(0,0,20,0)#" applicationtimeout="#createtimespan(1,0,0,0)#" !--params for clientinfo table-- cfparam name="session.lname" default="" cfparam name="session.fname" default="" cfparam name="session.email" default="" cfparam name="session.phone" default="" cfparam name="session.coname" default="" cfparam name="session.title" default="" Then the folowing templates ask for the user to input their names etc. in form fields where they get stired for the duration of the visit. like so; form action="screen2.cfm" method="POST" input type="Text" name="lname" size="25" value="":Last Namebr input type="Text" name="fname" size="25" value="":First Namebr input type="Text" name="email" size="25" value="": Emailbr input type="Text" name="phone" size="25" value="": Phone Numberbr input type="Text" name="coname" size="25" value="": Company Namebr input type="Text" name="title" size="25" value="": Titlebr input type="Submit" value="next" screen2.cfm; cfoutput Hello #session.fname# #session.lname#br Your email address is : #session.email#br /cfoutput etc. But the varibles entered on screen1 are not being passed to screen2.cfm? Now this should be really simle but I must be missing something. Can somebody please help me out. I would be eternally grateful. Thanks spencer the newbie -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=li sts/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: session variable blues
Spencer, You'll have to set your form variables as sessions variables on screen2.cfm before you can output them ... cfset session.lname = form.lname cfset session.fname = form.fname cfset session.email = form.email cfset session.phone = form.phone cfset session.coname = form.coname cfset session.title = form.title cfoutput Name: #session.fname# #session.lname#, #session.title#br Company: #session.coname#br Phone: #session.phone#br E-mail: a href="mailto:#session.email#"#session.email#/abr /cfoutput That should do it :-) - Jay Okay I'm a newbie and I'm having some trouble using session variables. They are not being stored it seems and therefore not being passed from template to template as the user moves through the app,. My application file looks like this cfapplication name="whatever" clientmanagement="Yes" sessionmanagement="Yes" setclientcookies="Yes" sessiontimeout="#createtimespan(0,0,20,0)#" applicationtimeout="#createtimespan(1,0,0,0)#" !--params for clientinfo table-- cfparam name="session.lname" default="" cfparam name="session.fname" default="" cfparam name="session.email" default="" cfparam name="session.phone" default="" cfparam name="session.coname" default="" cfparam name="session.title" default="" Then the folowing templates ask for the user to input their names etc. in form fields where they get stired for the duration of the visit. like so; form action="screen2.cfm" method="POST" input type="Text" name="lname" size="25" value="":Last Namebr input type="Text" name="fname" size="25" value="":First Namebr input type="Text" name="email" size="25" value="": Emailbr input type="Text" name="phone" size="25" value="": Phone Numberbr input type="Text" name="coname" size="25" value="": Company Namebr input type="Text" name="title" size="25" value="": Titlebr input type="Submit" value="next" screen2.cfm; cfoutput Hello #session.fname# #session.lname#br Your email address is : #session.email#br /cfoutput etc. But the varibles entered on screen1 are not being passed to screen2.cfm? Now this should be really simle but I must be missing something. Can somebody please help me out. I would be eternally grateful. Thanks spencer the newbie -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: session variable blues
Where are you "setting" (for examplecfset session.lname = "#form.lname#") the form fields to session variables? How would cf server know you wanted these form fields as session var's unless you tell it? :-) Seems your missing the step that sets the variables to seesion var's. This would be done on screen2.cfm, prior to trying to display them. cfset session.lname = "#form.lname#" cfset session.fname = "#form.fname#" cfset session.email = "#form.email#" cfset session.phone = "#form.phone#" cfset session.coname = "#form.coname#" cfset session.title = "#form.title#" Im not sure I understand your need for placing these cfparams in your application.cfm, but Im sure you have your reasons. Maybe these really belong in your "screen2.cfm" also? !--params for clientinfo table-- cfparam name="session.lname" default="" cfparam name="session.fname" default="" cfparam name="session.email" default="" cfparam name="session.phone" default="" cfparam name="session.coname" default="" cfparam name="session.title" default="" HTH, Steve - Original Message - From: Adrian Miller [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, May 08, 2000 08:16 AM Subject: RE: session variable blues from one newbie to another. Try using #Form.lname# instead of session. Hope this helps (probably won't though) -Original Message- From: Spencer Saunders [mailto:[EMAIL PROTECTED]] Sent: Monday, May 08, 2000 8:12 AM To: cftalk Subject: session variable blues Okay I'm a newbie and I'm having some trouble using session variables. They are not being stored it seems and therefore not being passed from template to template as the user moves through the app,. My application file looks like this cfapplication name="whatever" clientmanagement="Yes" sessionmanagement="Yes" setclientcookies="Yes" sessiontimeout="#createtimespan(0,0,20,0)#" applicationtimeout="#createtimespan(1,0,0,0)#" !--params for clientinfo table-- cfparam name="session.lname" default="" cfparam name="session.fname" default="" cfparam name="session.email" default="" cfparam name="session.phone" default="" cfparam name="session.coname" default="" cfparam name="session.title" default="" Then the folowing templates ask for the user to input their names etc. in form fields where they get stired for the duration of the visit. like so; form action="screen2.cfm" method="POST" input type="Text" name="lname" size="25" value="":Last Namebr input type="Text" name="fname" size="25" value="":First Namebr input type="Text" name="email" size="25" value="": Emailbr input type="Text" name="phone" size="25" value="": Phone Numberbr input type="Text" name="coname" size="25" value="": Company Namebr input type="Text" name="title" size="25" value="": Titlebr input type="Submit" value="next" screen2.cfm; cfoutput Hello #session.fname# #session.lname#br Your email address is : #session.email#br /cfoutput etc. But the varibles entered on screen1 are not being passed to screen2.cfm? Now this should be really simle but I must be missing something. Can somebody please help me out. I would be eternally grateful. Thanks spencer the newbie -- -- -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: session variable blues
if your going to store the form. variables as session variables for this one form then you need to change the attribute for them, a quick albeit dirty way to do it: cfloop list="#form.fieldlist#" index="field" cfset "session["#trim(field)#"] = "#evaluate("form.#trim(field)#")#" /cfloop Yikes, that really is dirty! Also, there's no variable called FORM.FIELDLIST, it's FORM.FIELDNAMES, and if there are duplicate names such as you'd have with a checkbox array or a multi-select box, you'll end up with only the last value. If you're using CF 4.5, both Session and Form are structures, so you can loop over the Form structure as a collection rather than looping over the list of field names: CFLOOP COLLECTION="#Form#" ITEM="myfield" CFSET Session[myfield] = Form[myfield] /CFLOOP If you're using CF 4.0.x, you could do this: CFLOOP LIST="#Form.Fieldnames#" INDEX="myfield" CFIF NOT IsDefined("Session." myfield) CFSET Session[myfield] = Evaluate("Form." myfield) /CFIF /CFLOOP Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: session variable blues
Thanks to all who helped me out. I'm starting to dig this cold fusion thing :) spence -Original Message- From: Stephen M. Aylor [EMAIL PROTECTED] To: [EMAIL PROTECTED] [EMAIL PROTECTED] Date: May 8, 2000 12:06 PM Subject: Re: session variable blues Where are you "setting" (for examplecfset session.lname = "#form.lname#") the form fields to session variables? How would cf server know you wanted these form fields as session var's unless you tell it? :-) Seems your missing the step that sets the variables to seesion var's. This would be done on screen2.cfm, prior to trying to display them. cfset session.lname = "#form.lname#" cfset session.fname = "#form.fname#" cfset session.email = "#form.email#" cfset session.phone = "#form.phone#" cfset session.coname = "#form.coname#" cfset session.title = "#form.title#" Im not sure I understand your need for placing these cfparams in your application.cfm, but Im sure you have your reasons. Maybe these really belong in your "screen2.cfm" also? !--params for clientinfo table-- cfparam name="session.lname" default="" cfparam name="session.fname" default="" cfparam name="session.email" default="" cfparam name="session.phone" default="" cfparam name="session.coname" default="" cfparam name="session.title" default="" HTH, Steve - Original Message - From: Adrian Miller [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, May 08, 2000 08:16 AM Subject: RE: session variable blues from one newbie to another. Try using #Form.lname# instead of session. Hope this helps (probably won't though) -Original Message- From: Spencer Saunders [mailto:[EMAIL PROTECTED]] Sent: Monday, May 08, 2000 8:12 AM To: cftalk Subject: session variable blues Okay I'm a newbie and I'm having some trouble using session variables. They are not being stored it seems and therefore not being passed from template to template as the user moves through the app,. My application file looks like this cfapplication name="whatever" clientmanagement="Yes" sessionmanagement="Yes" setclientcookies="Yes" sessiontimeout="#createtimespan(0,0,20,0)#" applicationtimeout="#createtimespan(1,0,0,0)#" !--params for clientinfo table-- cfparam name="session.lname" default="" cfparam name="session.fname" default="" cfparam name="session.email" default="" cfparam name="session.phone" default="" cfparam name="session.coname" default="" cfparam name="session.title" default="" Then the folowing templates ask for the user to input their names etc. in form fields where they get stired for the duration of the visit. like so; form action="screen2.cfm" method="POST" input type="Text" name="lname" size="25" value="":Last Namebr input type="Text" name="fname" size="25" value="":First Namebr input type="Text" name="email" size="25" value="": Emailbr input type="Text" name="phone" size="25" value="": Phone Numberbr input type="Text" name="coname" size="25" value="": Company Namebr input type="Text" name="title" size="25" value="": Titlebr input type="Submit" value="next" screen2.cfm; cfoutput Hello #session.fname# #session.lname#br Your email address is : #session.email#br /cfoutput etc. But the varibles entered on screen1 are not being passed to screen2.cfm? Now this should be really simle but I must be missing something. Can somebody please help me out. I would be eternally grateful. Thanks spencer the newbie - - -- -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. - - Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. --- --- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.