-
1. Re: Correct Scope for sessions
Dan Bracuk Apr 17, 2012 4:02 PM (in response to ACS LLC)You could put an empty structure into your session scope and add keys to it as required. Be careful about what you put into the session scope though. With all browser tabs and new browser windows sharing the same session, it's possible for values to be mistakenly overwritten.
-
2. Re: Correct Scope for sessions
ACS LLC Apr 17, 2012 5:02 PM (in response to Dan Bracuk)I am not concerned about the multiple windows as it's going to be used inside a mobile phone app that draws content from the server, and the app would just not allow more than one session to ever exist, so I'm safe in that department.
Could you possibly give me a small example of what you were describing?
Thanks
-
3. Re: Correct Scope for sessions
Adam Cameron. Apr 18, 2012 12:46 AM (in response to ACS LLC)Could you possibly give me a small example of what you were describing?
There's a whole section in the docs about how to use variables in CF. You should really make sure you know this stuff thoroughly if you're using CF (as it's about as fundamental as it gets when using a programming language):
Specifically:
struct[dynamicKeyName] = value
Where "struct" is the struct one is using (and a scope - for all intents and purposes - is a struct), "dynamicKeyName" is a string or a variable containing a string which is the name fo the key, and "value" is... err... the value.
But don't take my word for it: read the docs and get up to speed with all this stuff.
--
Adam
-
4. Re: Correct Scope for sessions
ACS LLC Apr 18, 2012 5:45 PM (in response to Adam Cameron.)Thanks for the links, after reading them and going back to what I originally had, I found the problem. I had a period after the #session which I should omit
<CFSET Session.10="a">
<CFSET TestField="10">
<CFOUTPUT>#session[testfield]#</CFOUTPUT>
Thanks
Mark
-
5. Re: Correct Scope for sessions
BKBK Apr 23, 2012 1:27 AM (in response to ACS LLC)Please kindly mark thread as answered. It will help others.
-
-