1) is session management enabled in a <cfapplication> tag?
2) that's some ugly naming conventions right there.  too many
variables with the same name.
3) why not just create the struct in the session?

<cfscript>
     session.student = structNew();
     session.student.name = "Fred";
</cfscript>

4) if you do plan on copying a local variable structure into another
scope (e.g. session), be aware that structs are copied by reference.
if you want a deep copy, you'll want the duplicate() function.  e.g.

<cfscript>
     variables.student = structNew();
     session.student = duplicate(varibles.student);
</cfscript>



On 9/25/06, Richard White <[EMAIL PROTECTED]> wrote:
> I am having trouble with the session variables. I know there must be a simple 
> solution but this is the first time i have used them and not sure what i am 
> doing wrong.
>
> I am trying to assign a structure to the session variable in one page and 
> then use that session structure in the forms action page.
>
> In the first page i am trying to assign it as as follows:
>
> <cfscript>
>       student = StructNew();
>       student.name = "Fred"
>       session.student = student;
> </cfscript>
>
> then in the action page i am trying to call it as follows:
>
> <cfif form.studentName neq session.student.name>
>   <cfoutput>not found</cfoutput>
> <cfelse>
>   <cfoutput>found</cfoutput>
> </cfif>
>
> it is telling me that the session variable is undefined
>
> thanks for any help
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:254118
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to