Re: Cannot access session variables in a cfc

2015-01-29 Thread Scott Stewart

Some of the dangers to this approach include:  the amount of memory
allocated to the JVM. If you stuff alot of data into the Application scope,
it persists in the JVM allocated memory and it's not available to the rest
of the system/application.

You really can't change data in the Application scope without having to
reload it.

I generally use the Application scope for application wide CFC
instantiation, the and not actual application wide data.

Just my $.02

sas

On Thu, Jan 29, 2015 at 11:53 AM, John Pullam jpul...@mcleansystems.com
wrote:


 For what it's worth, the approach of storing a global data item in the
 application scope seems to be legit according to the documentation. Here's
 what it said in the CF10 doc:

 Application variables are a convenient place to store information that all
 pages of your application might need, no matter which client is running
 that application. Using application variables, an application could, for
 example, initialize itself when the first user accesses any page of that
 application. This information can then remain available indefinitely,
 thereby avoiding the overhead of repeated initialization.

 Because the data stored in application variables is available to all pages
 of an application, and remains available until a specific period of
 inactivity passes or the ColdFusion server shuts down, application
 variables are convenient for application-global, persistent data.

 However, because all clients running an application see the same set of
 application variables, these variables are not appropriate for
 client-specific or session-specific information. To target variables for
 specific clients, use client or session variables.

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360042
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Cannot access session variables in a cfc

2015-01-29 Thread John Pullam

For what it's worth, the approach of storing a global data item in the 
application scope seems to be legit according to the documentation. Here's what 
it said in the CF10 doc:

Application variables are a convenient place to store information that all 
pages of your application might need, no matter which client is running that 
application. Using application variables, an application could, for example, 
initialize itself when the first user accesses any page of that application. 
This information can then remain available indefinitely, thereby avoiding the 
overhead of repeated initialization.

Because the data stored in application variables is available to all pages of 
an application, and remains available until a specific period of inactivity 
passes or the ColdFusion server shuts down, application variables are 
convenient for application-global, persistent data.

However, because all clients running an application see the same set of 
application variables, these variables are not appropriate for client-specific 
or session-specific information. To target variables for specific clients, use 
client or session variables. 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360041
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Cannot access session variables in a cfc

2015-01-29 Thread Scott Stewart

+1

On Thu, Jan 29, 2015 at 12:53 PM, Russ Michaels r...@michaels.me.uk wrote:


 I'll add for the sake of brevity, please don't put application wide cfcs in
 session scope, as a hosting provider I have seen this kill a server. 5000
 users = 5000 instances of the cfc.

 In most cases using a mapping solves the issues you have with cf not
 finding the cfc.


 On Thu, Jan 29, 2015 at 17:00 PM, Scott Stewart webmas...@sstwebworks.com
 
 wrote:


 Some of the dangers to this approach include:  the amount of memory
 allocated to the JVM. If you stuff alot of data into the Application scope,
 it persists in the JVM allocated memory and it's not available to the rest
 of the system/application.

 You really can't change data in the Application scope without having to
 reload it.

 I generally use the Application scope for application wide CFC
 instantiation, the and not actual application wide data.

 Just my $.02

 sas

 On Thu, Jan 29, 2015 at 11:53 AM, John Pullam jpul...@mcleansystems.com
 javascript:;
 wrote:

 
  For what it's worth, the approach of storing a global data item in the
  application scope seems to be legit according to the documentation.
 Here's
  what it said in the CF10 doc:
 
  Application variables are a convenient place to store information that
 all
  pages of your application might need, no matter which client is running
  that application. Using application variables, an application could, for
  example, initialize itself when the first user accesses any page of that
  application. This information can then remain available indefinitely,
  thereby avoiding the overhead of repeated initialization.
 
  Because the data stored in application variables is available to all
 pages
  of an application, and remains available until a specific period of
  inactivity passes or the ColdFusion server shuts down, application
  variables are convenient for application-global, persistent data.
 
  However, because all clients running an application see the same set of
  application variables, these variables are not appropriate for
  client-specific or session-specific information. To target variables for
  specific clients, use client or session variables.
 
 



 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360044
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Cannot access session variables in a cfc

2015-01-29 Thread Russ Michaels

I'll add for the sake of brevity, please don't put application wide cfcs in
session scope, as a hosting provider I have seen this kill a server. 5000
users = 5000 instances of the cfc.

In most cases using a mapping solves the issues you have with cf not
finding the cfc.


On Thu, Jan 29, 2015 at 17:00 PM, Scott Stewart webmas...@sstwebworks.com
wrote:


Some of the dangers to this approach include:  the amount of memory
allocated to the JVM. If you stuff alot of data into the Application scope,
it persists in the JVM allocated memory and it's not available to the rest
of the system/application.

You really can't change data in the Application scope without having to
reload it.

I generally use the Application scope for application wide CFC
instantiation, the and not actual application wide data.

Just my $.02

sas

On Thu, Jan 29, 2015 at 11:53 AM, John Pullam jpul...@mcleansystems.com
javascript:;
wrote:


 For what it's worth, the approach of storing a global data item in the
 application scope seems to be legit according to the documentation. Here's
 what it said in the CF10 doc:

 Application variables are a convenient place to store information that all
 pages of your application might need, no matter which client is running
 that application. Using application variables, an application could, for
 example, initialize itself when the first user accesses any page of that
 application. This information can then remain available indefinitely,
 thereby avoiding the overhead of repeated initialization.

 Because the data stored in application variables is available to all pages
 of an application, and remains available until a specific period of
 inactivity passes or the ColdFusion server shuts down, application
 variables are convenient for application-global, persistent data.

 However, because all clients running an application see the same set of
 application variables, these variables are not appropriate for
 client-specific or session-specific information. To target variables for
 specific clients, use client or session variables.





~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360043
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: Cannot access session variables in a cfc

2015-01-28 Thread Robert Harrison

Were you using relative paths to the CFCs.  That could become hairy if you
move things around. 

I'll generally define a CFC path variable in the application.cfm then use
that everywhere.  Never had a problem.  Of course, this assumes all the
CFC's are in the same location. 

Robert Harrison
Full Stack Developer
AIMG
rharri...@aimg.com
Main Office: 704-321-1234  ext.118
Direct Line: 516-302-4345
www.aimg.com



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360023
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: Cannot access session variables in a cfc

2015-01-28 Thread William Seiter

Can you give us some code examples of how it 'used' to be setup?

Where was the CFC saved.
Where was the CFC called.
How was it called.
Etc.

Not that fixing the actual problem will set you suddenly into best
practices, but it will fix your current headache and then you can follow up
with BP later when the fires are out.

Thanks,
William


--
William Seiter


-Original Message-
From: John Pullam [mailto:jpul...@mcleansystems.com] 
Sent: Wednesday, January 28, 2015 8:57 AM
To: cf-talk
Subject: Re: Cannot access session variables in a cfc


I know this isn't ideal, but it is a live application and the decision to
move the cfc's outside of the doc root was taken because CF was having
trouble finding them (for no obvious reason). Code that has worked since CF7
started breaking.

So we moved them and this problem began. 

I am looking for a quick solution for now, knowing that I need to develop a
better one.

I'm wondering about putting the variable in the Application scope? Do the
cfc's have access to that? 



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360024
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Cannot access session variables in a cfc

2015-01-28 Thread John Pullam

You will need to pass your session variables as a parameter in order to use
them in the CFC, this is best practices anyways.

The difficulty is that there a lot of cfc calls and some of them are in bind 
expressions so the chance of making errors is high. That's why I am so anxious 
to find one that doesn't make me change a lot of programming. Long term I will 
opt for a better solution.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360025
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Cannot access session variables in a cfc

2015-01-28 Thread Byron Mann

On Wed, Jan 28, 2015 at 1:57 PM, Robert Harrison rharri...@aimg.com wrote:


  try adding an Application.cfc in the root physical directory

 I don't that that will work. It would still be a separate application pool,
 and I think you need the CFID and CFTOKEN cookies to have session vars.




Did a simple test on CF10 and CF8 and this does seem to work.  The only
identifier for an application is the application name that I'm aware of, so
I would guess the first Application.cfc to be called would be the one to
initialize the application.  Subsequent calls would set the session and
application timeouts, thus setting them the same would be a good idea.

That being said, Dean's proxy suggestion is probably best, since you would
probably want the code to run from either application.cfc.

I thought the directory structure might be like this. The proxy would still
work, but would probably just need a cfmapping to the app root so the
/cfc/application.cfc could find the /app/applicationproxy.cfc.

/cfc
/app
/app/application.cfc


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360035
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Cannot access session variables in a cfc

2015-01-28 Thread Byron Mann

@Dean,

Looked into this a bit further on CF10.

root
- Application.cfc
- ApplicationProxy.cfc (extends Application)
- cfc-folder
- - Application.cfc (extends ApplicationProxy)
- - myCFC.cfc

This does not work without the cfc/application.cfc having
extends=root.ApplicationProxy, where 'root' is a CF mapping.

As you said, CF will search from the application root downward on the file
system. Since there is an Application.cfc in the cfc folder, it would start
there and not find the ApplicationProxy in the directory above.

This would work if the actual root directory was cfusion/wwwroot, or maybe
if both application.cfc had the same applicationName and the
ApplicationProxy was used/cached in /root app somehow before /root/cfc was
initialized.

If you use a CF mapping the proxy is really not even necessary, as this
does work.

/cfc/application.cfc
-
cfcomponent extends=root.application

Cheers,
Byron








On Wed, Jan 28, 2015 at 3:44 PM, Dean Lawrence dean...@gmail.com wrote:


 Byron, the ApplicationProxy.cfc needs to be in the root directory along
 with the main Application.cfc. When you extend a CFC, CF will first look in
 the same directory to see if that CFC exist. If it doesn't CF will start
 looking for the CFC from the application root down. So by simply adding
 extends=ApplicationProxy to the Application.cfc within the /cfc
 directory, CF will find the ApplicationProxy.cfc in the root, which in turn
 finds the Application.cfc in the root. No mappings are needed.

 T


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360039
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Cannot access session variables in a cfc

2015-01-28 Thread Dean Lawrence

Byron, the ApplicationProxy.cfc needs to be in the root directory along
with the main Application.cfc. When you extend a CFC, CF will first look in
the same directory to see if that CFC exist. If it doesn't CF will start
looking for the CFC from the application root down. So by simply adding
extends=ApplicationProxy to the Application.cfc within the /cfc
directory, CF will find the ApplicationProxy.cfc in the root, which in turn
finds the Application.cfc in the root. No mappings are needed.

On Wed, Jan 28, 2015 at 3:21 PM, Byron Mann byronos...@gmail.com wrote:


 On Wed, Jan 28, 2015 at 1:57 PM, Robert Harrison rharri...@aimg.com
 wrote:

 
   try adding an Application.cfc in the root physical directory
 
  I don't that that will work. It would still be a separate application
 pool,
  and I think you need the CFID and CFTOKEN cookies to have session vars.
 



 Did a simple test on CF10 and CF8 and this does seem to work.  The only
 identifier for an application is the application name that I'm aware of, so
 I would guess the first Application.cfc to be called would be the one to
 initialize the application.  Subsequent calls would set the session and
 application timeouts, thus setting them the same would be a good idea.

 That being said, Dean's proxy suggestion is probably best, since you would
 probably want the code to run from either application.cfc.

 I thought the directory structure might be like this. The proxy would still
 work, but would probably just need a cfmapping to the app root so the
 /cfc/application.cfc could find the /app/applicationproxy.cfc.

 /cfc
 /app
 /app/application.cfc


 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360036
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Cannot access session variables in a cfc

2015-01-28 Thread Dean Lawrence

Hmm, that's odd as I use that setup on numerous sites and I never have to
map the applicationproxy. I am currently using it on both ACF 10 and 11,
but I started using this around 8 or 9 and haven't changed it for new
version. I don't believe that you could use the root.(dot) notation in 8 or
9, which if I remember correctly, predicated the use of the proxy. Every
site is also housed in completely different directories, nowhere near the
cfusion/wwwroot directory, so I am not sure why it is didn't work for you
as well. Anyway, thanks for the additional info regarding cutting out the
proxy step.

On Wed, Jan 28, 2015 at 4:54 PM, Byron Mann byronos...@gmail.com wrote:


 @Dean,

 Looked into this a bit further on CF10.

 root
 - Application.cfc
 - ApplicationProxy.cfc (extends Application)
 - cfc-folder
 - - Application.cfc (extends ApplicationProxy)
 - - myCFC.cfc

 This does not work without the cfc/application.cfc having
 extends=root.ApplicationProxy, where 'root' is a CF mapping.

 As you said, CF will search from the application root downward on the file
 system. Since there is an Application.cfc in the cfc folder, it would start
 there and not find the ApplicationProxy in the directory above.

 This would work if the actual root directory was cfusion/wwwroot, or maybe
 if both application.cfc had the same applicationName and the
 ApplicationProxy was used/cached in /root app somehow before /root/cfc was
 initialized.

 If you use a CF mapping the proxy is really not even necessary, as this
 does work.

 /cfc/application.cfc
 -
 cfcomponent extends=root.application

 Cheers,
 Byron








 On Wed, Jan 28, 2015 at 3:44 PM, Dean Lawrence dean...@gmail.com wrote:

 
  Byron, the ApplicationProxy.cfc needs to be in the root directory along
  with the main Application.cfc. When you extend a CFC, CF will first look
 in
  the same directory to see if that CFC exist. If it doesn't CF will start
  looking for the CFC from the application root down. So by simply adding
  extends=ApplicationProxy to the Application.cfc within the /cfc
  directory, CF will find the ApplicationProxy.cfc in the root, which in
 turn
  finds the Application.cfc in the root. No mappings are needed.
 
  T


 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360040
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Cannot access session variables in a cfc

2015-01-28 Thread John Pullam

My app is running in a CF10 system and since I moved my cfc's out of the 
document root, they are losing access to the session variables. It seems that 
they work for around a day and then can no longer be found. I initialize them 
in my application.cfm to a value and I can still cfdump them in a regular web 
page, but the cfc fails with the error Element XXX is undefined in SESSION.

Is this normal behaviour? If it is, then what is the alternative method of 
passing a variable into the cfc (other than making it a parameter when 
calling)? 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360014
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: Cannot access session variables in a cfc

2015-01-28 Thread Robert Harrison

 What other method than session variables can I use to pass a common
variable that won't require me to include it as a parameter of every calling
routine?

Since you've moved your CFCs out of the application I cannot think of any
other method beside passing them all as arguments. 

Robert Harrison
Full Stack Developer
AIMG
rharri...@aimg.com
Main Office: 704-321-1234  ext.118
Direct Line: 516-302-4345
www.aimg.com


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360018
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: Cannot access session variables in a cfc

2015-01-28 Thread Robert Harrison

If you moved your cfc's above the application.cfc (or application.cfm) file,
the session variables will not be accessible. Session and application vars
are accessible from the application file down. 


Robert Harrison
Full Stack Developer
AIMG
rharri...@aimg.com
Main Office: 704-321-1234  ext.118
Direct Line: 516-302-4345
www.aimg.com



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360015
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Cannot access session variables in a cfc

2015-01-28 Thread John Pullam

If you moved your cfc's above the application.cfc (or application.cfm) file,
the session variables will not be accessible. Session and application vars
are accessible from the application file down. 

That's what we did.

What other method than session variables can I use to pass a common variable 
that won't require me to include it as a parameter of every calling routine? 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360016
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Cannot access session variables in a cfc

2015-01-28 Thread Steve 'Cutter' Blades

You shouldn't, as it breaks encapsulation. Any outside variables you 
would need inside a cfc should be passed into the cfc, either as part of 
your object initialization, or directly into a specific method.

Cutter

On 1/28/2015 10:25 AM, John Pullam wrote:
 If you moved your cfc's above the application.cfc (or application.cfm) file,
 the session variables will not be accessible. Session and application vars
 are accessible from the application file down.

 That's what we did.

 What other method than session variables can I use to pass a common variable 
 that won't require me to include it as a parameter of every calling routine?



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360017
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Cannot access session variables in a cfc

2015-01-28 Thread John Pullam

Thanx. That's what I think I will do for the time being.

It is hard for me to come up with all the symptoms that we started seeing on 
the cfc's now and I don't think I could do justice to any explanation of those 
issues. It seemed to me that it was all quite normal stuff. All pages and cfc's 
were in the same doc root. And I have had issues with cfc locations on my test 
system because it gets confused with localhost and virtual directories, so 
getting the cfc's into a separate folder had a certain appeal.

I'm planning to do a big refresh on the app over the summer and this is going 
to be addressed then. In the meantime, I have my fingers crossed than an 
application scoped variable will get us through.

Thanx again. 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360027
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: Cannot access session variables in a cfc

2015-01-28 Thread Robert Harrison

 You shouldn't, as it breaks encapsulation

Honestly, I too think you should reconsider moving the CFC out of the web
root.  

Maybe if you moved them out then created objects from them in the
application.cfc, then you may be able to use session vars, as I think the
objects would still be in the application. 


Robert Harrison
Full Stack Developer
AIMG
rharri...@aimg.com
Main Office: 704-321-1234  ext.118
Direct Line: 516-302-4345
www.aimg.com



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360020
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: Cannot access session variables in a cfc

2015-01-28 Thread William Seiter

You will need to pass your session variables as a parameter in order to use
them in the CFC, this is best practices anyways.

Good news, however, is that you can send them as a complete struct, you
don't necessarily need to have them send all separately.

cfargument name=sSession type=struct required=yes /

Hope this helps,
William

--
William Seiter

-Original Message-
From: John Pullam [mailto:jpul...@mcleansystems.com] 
Sent: Wednesday, January 28, 2015 8:08 AM
To: cf-talk
Subject: Cannot access session variables in a cfc


My app is running in a CF10 system and since I moved my cfc's out of the
document root, they are losing access to the session variables. It seems
that they work for around a day and then can no longer be found. I
initialize them in my application.cfm to a value and I can still cfdump them
in a regular web page, but the cfc fails with the error Element XXX is
undefined in SESSION.

Is this normal behaviour? If it is, then what is the alternative method of
passing a variable into the cfc (other than making it a parameter when
calling)? 



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360022
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Cannot access session variables in a cfc

2015-01-28 Thread John Pullam

I know this isn't ideal, but it is a live application and the decision to move 
the cfc's outside of the doc root was taken because CF was having trouble 
finding them (for no obvious reason). Code that has worked since CF7 started 
breaking.

So we moved them and this problem began. 

I am looking for a quick solution for now, knowing that I need to develop a 
better one.

I'm wondering about putting the variable in the Application scope? Do the cfc's 
have access to that? 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360021
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: Cannot access session variables in a cfc

2015-01-28 Thread Robert Harrison

Well, I'd hate to do this, but you could define an application.myvar type
variable and put all the variables you need to pass in that as a structure
or list, then send that variable in your arguments.  That would get to one
variable ... but then you're still going to need to deconstruct it before
you could use them in the CFC's.

Personally I think you should put your CFC's back and fix the problem that's
making you move them in the first place.  

Robert Harrison
Full Stack Developer
AIMG
rharri...@aimg.com
Main Office: 704-321-1234  ext.118
Direct Line: 516-302-4345
www.aimg.com


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360026
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Cannot access session variables in a cfc

2015-01-28 Thread Byron Mann

While I agree it isn't a good practice to make use of scope variables in a
CFC, try adding an Application.cfc in the root physical directory of your
CFCs and use the same application name and session and app timeouts.

I think this would work in older versions, but not too sure about more
recent versions.

On Wed, Jan 28, 2015 at 11:08 AM, John Pullam jpul...@mcleansystems.com
wrote:


 My app is running in a CF10 system and since I moved my cfc's out of the
 document root, they are losing access to the session variables. It seems
 that they work for around a day and then can no longer be found. I
 initialize them in my application.cfm to a value and I can still cfdump
 them in a regular web page, but the cfc fails with the error Element XXX
 is undefined in SESSION.

 Is this normal behaviour? If it is, then what is the alternative method of
 passing a variable into the cfc (other than making it a parameter when
 calling)?

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360030
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: Cannot access session variables in a cfc

2015-01-28 Thread Robert Harrison

 try adding an Application.cfc in the root physical directory

I don't that that will work. It would still be a separate application pool,
and I think you need the CFID and CFTOKEN cookies to have session vars. 

Robert Harrison
Full Stack Developer
AIMG
rharri...@aimg.com
Main Office: 704-321-1234  ext.118
Direct Line: 516-302-4345
www.aimg.com


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360031
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Cannot access session variables in a cfc

2015-01-28 Thread Dean Lawrence

You could also extend the main application.cfc. You can't do this directly
if the cfc's are in a sub-directory though. If that is the case, you could
use a proxy, I do this all the time. Here would be the structure.

root
- Application.cfc
- ApplicationProxy.cfc (extends Application)
- cfc-folder
- - Application.cfc (extends ApplicationProxy)
- - myCFC.cfc

You will probably want to also call super.onApplicationStart() from within
the cfc folder Application.cfc's onApplicationStart() method. The same
would hold true for onSessionStart(), you would want to call
super.OnSessionStart(). This ensures that all the main application and
session vars get initialized properly.

On Wed, Jan 28, 2015 at 1:57 PM, Robert Harrison rharri...@aimg.com wrote:


  try adding an Application.cfc in the root physical directory

 I don't that that will work. It would still be a separate application pool,
 and I think you need the CFID and CFTOKEN cookies to have session vars.

 Robert Harrison
 Full Stack Developer
 AIMG
 rharri...@aimg.com
 Main Office: 704-321-1234  ext.118
 Direct Line: 516-302-4345
 www.aimg.com


 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360032
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Cannot access session variables in a cfc

2015-01-28 Thread Steve 'Cutter' Blades

John,

There are some pretty significant advancements to CFCs since CF 7, 
especially around scoping. You definitely want to look at the difference 
up the version chain.

Cutter

On 1/28/2015 12:02 PM, John Pullam wrote:
 Thanx. That's what I think I will do for the time being.

 It is hard for me to come up with all the symptoms that we started seeing on 
 the cfc's now and I don't think I could do justice to any explanation of 
 those issues. It seemed to me that it was all quite normal stuff. All pages 
 and cfc's were in the same doc root. And I have had issues with cfc locations 
 on my test system because it gets confused with localhost and virtual 
 directories, so getting the cfc's into a separate folder had a certain appeal.

 I'm planning to do a big refresh on the app over the summer and this is going 
 to be addressed then. In the meantime, I have my fingers crossed than an 
 application scoped variable will get us through.

 Thanx again.



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360034
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Issue using CF to set Java server variables

2014-08-12 Thread Scott Weikert

The last few days, my production webserver has had an issue with Java 
unable to create cache files. This is triggered when firing a cfimage 
tag, pointing at a graphic file in the filesystem, the purpose of which 
is to retrieve the width/height values.

As best I can tell (as this is generally outside my area of expertise), 
the issue is the default directory Java uses for this purpose has a) 
vanished or b) had its permissions reset to disallow access.

The trick is, I don't know how to determine what this default directory 
is, to then check the filesystem to see what's what.

I am able (using CF and createObject) tap into the Java method 
getCacheDirectory(), but the issue there is if this value isn't 
specifically set (i.e. the default is used), it returns a null value, 
and not the actual directory path being used. And I'm getting said null 
value, so that's of no help.

I'm trying to use another method, setCacheDirectory(), to specifically 
set that value to a given location - but I cannot puzzle out the CF 
syntax to make this work.

Below is the code I'm using to tap the getCacheDirectory() method, and 
what's not working on setCacheDirectory(). I'm creating an object to the 
File class first, to use for the get call, and then (as best I can 
tell according to some Java docs at Oracle) I need to reference that 
class in the set call.

cfset objFile = createObject(java, 
java.io.File).init(expandPath(/))/
free space: #objFile.getFreeSpace()#   (returns free space on server drive)

cfset  objImageIO = createObject(java, javax.imageio.ImageIO) /
cache directory: #objImageIO.getCacheDirectory()#(returns null value)
usecache: #objImageIO.getUseCache()#(returns true - true means file 
caching, false means memory caching)

cfset x = objImageIO.setCacheDirectory(objFile, 
'/var/www/nnd/htdocs/imageCache/') 
This call fails with The setCacheDirectory method was not found.

Basically I'm stumped on the syntax of the last call. I'm not even sure, 
should I get this worked out and the call is successful, that it will 
solve the cache-failing issue, but it's my best lead so far.

Any assistance on this syntax problem would be greatly appreciated!
--Scott

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359109
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


# in variables

2014-02-07 Thread Bryan Stevenson

Hey All,

I've got an issue where an external program written in Adobe AIR is 
passing a pipe delimited list of values to CF via a webservice and that 
list may contain strings like so #94; (a caret symbol)or just a 
straight up # (like someone saying x# of y - short form for x number of 
y).  BTW in Adobe AIR caret symbols in the data values in the list are 
being replaced with #94; because the caret is a special character in 
the pipe delimited list (it's used as a sub-list delimiter).

CF chokes on the single pound in the variable (or confuses everything 
between 2 # as a variable name instead of simple values).

I'm having quite the brain fart day and so I'm looking for a way to deal 
with this reality - any thoughts?

TIA

Take care

-Bryan

-- 
*Bryan Stevenson*B.Comm.
President  CEO
Electric Edge Systems Group Inc. - makers of FACTS^(TM)
phone: 250.480.0642
cell: 250.920.8830
e-mail: br...@electricedgesystems.com mailto:br...@electricedgesystems.com
web: www.electricedgesystems.com http://www.electricedgesystems.com 
and www.fisheryfacts.com http://www.fisheryfacts.com



Please consider the environment before printing this e-mail

-CONFIDENTIALITY--
This message, including any attachments, is confidential and may contain 
information that is privileged or exempt from disclosure. It is intended 
only for the person to whom it is addressed unless expressly authorized 
otherwise by the sender. If you are not an authorized recipient, please 
notify the sender immediately and permanently destroy all copies of this 
message and attachments.


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357614
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: # in variables

2014-02-07 Thread Rob Parkhill

Run a Replace on the string of data, and change the single # to a double ##
that then CF would process as a single one?


On Fri, Feb 7, 2014 at 11:58 AM, Bryan Stevenson 
br...@electricedgesystems.com wrote:


 Hey All,

 I've got an issue where an external program written in Adobe AIR is
 passing a pipe delimited list of values to CF via a webservice and that
 list may contain strings like so #94; (a caret symbol)or just a
 straight up # (like someone saying x# of y - short form for x number of
 y).  BTW in Adobe AIR caret symbols in the data values in the list are
 being replaced with #94; because the caret is a special character in
 the pipe delimited list (it's used as a sub-list delimiter).

 CF chokes on the single pound in the variable (or confuses everything
 between 2 # as a variable name instead of simple values).

 I'm having quite the brain fart day and so I'm looking for a way to deal
 with this reality - any thoughts?

 TIA

 Take care

 -Bryan

 --
 *Bryan Stevenson*B.Comm.
 President  CEO
 Electric Edge Systems Group Inc. - makers of FACTS^(TM)
 phone: 250.480.0642
 cell: 250.920.8830
 e-mail: br...@electricedgesystems.com mailto:
 br...@electricedgesystems.com
 web: www.electricedgesystems.com http://www.electricedgesystems.com
 and www.fisheryfacts.com http://www.fisheryfacts.com

 

 Please consider the environment before printing this e-mail

 -CONFIDENTIALITY--
 This message, including any attachments, is confidential and may contain
 information that is privileged or exempt from disclosure. It is intended
 only for the person to whom it is addressed unless expressly authorized
 otherwise by the sender. If you are not an authorized recipient, please
 notify the sender immediately and permanently destroy all copies of this
 message and attachments.


 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357615
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: # in variables

2014-02-07 Thread Bryan Stevenson

BTWI forgot to mention that I control the Adobe AIR application and 
can alter it.  This is all about a comments field in that application 
and I suppose one solution would be to ensure that my special list 
delimiter characters and # are kept out of the comments and this whole 
issue goes away ;-)

but if there is a workable solution I always prefer to not restrict 
user entry in that way.

Cheers

*Bryan Stevenson*B.Comm.
President  CEO
Electric Edge Systems Group Inc. - makers of FACTS^(TM)
phone: 250.480.0642
cell: 250.920.8830
e-mail: br...@electricedgesystems.com mailto:br...@electricedgesystems.com
web: www.electricedgesystems.com http://www.electricedgesystems.com 
and www.fisheryfacts.com http://www.fisheryfacts.com



Please consider the environment before printing this e-mail

-CONFIDENTIALITY--
This message, including any attachments, is confidential and may contain 
information that is privileged or exempt from disclosure. It is intended 
only for the person to whom it is addressed unless expressly authorized 
otherwise by the sender. If you are not an authorized recipient, please 
notify the sender immediately and permanently destroy all copies of this 
message and attachments.
On 14-02-07 08:58 AM, Bryan Stevenson wrote:
 Hey All,

 I've got an issue where an external program written in Adobe AIR is
 passing a pipe delimited list of values to CF via a webservice and that
 list may contain strings like so #94; (a caret symbol)or just a
 straight up # (like someone saying x# of y - short form for x number of
 y).  BTW in Adobe AIR caret symbols in the data values in the list are
 being replaced with #94; because the caret is a special character in
 the pipe delimited list (it's used as a sub-list delimiter).

 CF chokes on the single pound in the variable (or confuses everything
 between 2 # as a variable name instead of simple values).

 I'm having quite the brain fart day and so I'm looking for a way to deal
 with this reality - any thoughts?

 TIA

 Take care

 -Bryan




~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357616
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: # in variables

2014-02-07 Thread Russ Michaels

if you control the air app, then just send ## instead of #


On Fri, Feb 7, 2014 at 5:09 PM, Bryan Stevenson 
br...@electricedgesystems.com wrote:


 BTWI forgot to mention that I control the Adobe AIR application and
 can alter it.  This is all about a comments field in that application
 and I suppose one solution would be to ensure that my special list
 delimiter characters and # are kept out of the comments and this whole
 issue goes away ;-)

 but if there is a workable solution I always prefer to not restrict
 user entry in that way.

 Cheers

 *Bryan Stevenson*B.Comm.
 President  CEO
 Electric Edge Systems Group Inc. - makers of FACTS^(TM)
 phone: 250.480.0642
 cell: 250.920.8830
 e-mail: br...@electricedgesystems.com mailto:
 br...@electricedgesystems.com
 web: www.electricedgesystems.com http://www.electricedgesystems.com
 and www.fisheryfacts.com http://www.fisheryfacts.com

 

 Please consider the environment before printing this e-mail

 -CONFIDENTIALITY--
 This message, including any attachments, is confidential and may contain
 information that is privileged or exempt from disclosure. It is intended
 only for the person to whom it is addressed unless expressly authorized
 otherwise by the sender. If you are not an authorized recipient, please
 notify the sender immediately and permanently destroy all copies of this
 message and attachments.
 On 14-02-07 08:58 AM, Bryan Stevenson wrote:
  Hey All,
 
  I've got an issue where an external program written in Adobe AIR is
  passing a pipe delimited list of values to CF via a webservice and that
  list may contain strings like so #94; (a caret symbol)or just a
  straight up # (like someone saying x# of y - short form for x number of
  y).  BTW in Adobe AIR caret symbols in the data values in the list are
  being replaced with #94; because the caret is a special character in
  the pipe delimited list (it's used as a sub-list delimiter).
 
  CF chokes on the single pound in the variable (or confuses everything
  between 2 # as a variable name instead of simple values).
 
  I'm having quite the brain fart day and so I'm looking for a way to deal
  with this reality - any thoughts?
 
  TIA
 
  Take care
 
  -Bryan
 



 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357617
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: # in variables

2014-02-07 Thread Bryan Stevenson

Thanks Robsorry I should have mentioned that was the first thing I 
tried (ye old double up the #), but the issue seems to be that when a 
variable arrives on CF's door with a single # in it, CF bombs when 
attempting to run the replace.  Now I did say seemsthe way my day 
has goneI will re-test that to make dang sure ;-)

Cheers

On 14-02-07 09:08 AM, Rob Parkhill wrote:
 Run a Replace on the string of data, and change the single # to a double ##
 that then CF would process as a single one?



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357618
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: # in variables

2014-02-07 Thread Rob Parkhill

I thought the #'s were inside the list.  If not and you control the AIR
app, then just add the replace on the other end, as Russ suggested.


On Fri, Feb 7, 2014 at 12:20 PM, Bryan Stevenson 
br...@electricedgesystems.com wrote:


 Thanks Robsorry I should have mentioned that was the first thing I
 tried (ye old double up the #), but the issue seems to be that when a
 variable arrives on CF's door with a single # in it, CF bombs when
 attempting to run the replace.  Now I did say seemsthe way my day
 has goneI will re-test that to make dang sure ;-)

 Cheers

 On 14-02-07 09:08 AM, Rob Parkhill wrote:
  Run a Replace on the string of data, and change the single # to a double
 ##
  that then CF would process as a single one?



 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357619
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: # in variables

2014-02-07 Thread Bryan Stevenson

Thanks Rob/Russstarting to think I will either do as you both 
suggested and replace # with ## in the AIR app or do as I also mentioned 
and not allow the few characters I'd have issues with (most users don't 
need ~,|,^, or # in comments# being the most likely, but they can 
use No. or Num or Number or pounds or lbs as acceptable 
replacements).

Sometimes you just have to back away one step from perfect and become 
practical ;-)

Cheers

*Bryan Stevenson*B.Comm.
President  CEO
Electric Edge Systems Group Inc. - makers of FACTS^(TM)
phone: 250.480.0642
cell: 250.920.8830
e-mail: br...@electricedgesystems.com mailto:br...@electricedgesystems.com
web: www.electricedgesystems.com http://www.electricedgesystems.com 
and www.fisheryfacts.com http://www.fisheryfacts.com



Please consider the environment before printing this e-mail

-CONFIDENTIALITY--
This message, including any attachments, is confidential and may contain 
information that is privileged or exempt from disclosure. It is intended 
only for the person to whom it is addressed unless expressly authorized 
otherwise by the sender. If you are not an authorized recipient, please 
notify the sender immediately and permanently destroy all copies of this 
message and attachments.
On 14-02-07 09:28 AM, Rob Parkhill wrote:
 I thought the #'s were inside the list.  If not and you control the AIR
 app, then just add the replace on the other end, as Russ suggested.


 On Fri, Feb 7, 2014 at 12:20 PM, Bryan Stevenson 
 br...@electricedgesystems.com wrote:

 Thanks Robsorry I should have mentioned that was the first thing I
 tried (ye old double up the #), but the issue seems to be that when a
 variable arrives on CF's door with a single # in it, CF bombs when
 attempting to run the replace.  Now I did say seemsthe way my day
 has goneI will re-test that to make dang sure ;-)

 Cheers

 On 14-02-07 09:08 AM, Rob Parkhill wrote:
 Run a Replace on the string of data, and change the single # to a double
 ##
 that then CF would process as a single one?



 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357620
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: # in variables

2014-02-07 Thread Timothy Heald

There are a few formatting functions in cf you might want to try that
spring top mind.  UrlEncodedFormat, htmlEditFormat I think.  Look at the
string and list functions on live docs.
On Feb 7, 2014 12:29 PM, Rob Parkhill robert.parkh...@gmail.com wrote:


 I thought the #'s were inside the list.  If not and you control the AIR
 app, then just add the replace on the other end, as Russ suggested.


 On Fri, Feb 7, 2014 at 12:20 PM, Bryan Stevenson 
 br...@electricedgesystems.com wrote:

 
  Thanks Robsorry I should have mentioned that was the first thing I
  tried (ye old double up the #), but the issue seems to be that when a
  variable arrives on CF's door with a single # in it, CF bombs when
  attempting to run the replace.  Now I did say seemsthe way my day
  has goneI will re-test that to make dang sure ;-)
 
  Cheers
 
  On 14-02-07 09:08 AM, Rob Parkhill wrote:
   Run a Replace on the string of data, and change the single # to a
 double
  ##
   that then CF would process as a single one?
 
 
 
 

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357621
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: # in variables

2014-02-07 Thread Timothy Heald

Encode/serialize the data prior to hand off to cf?
On Feb 7, 2014 12:37 PM, Bryan Stevenson br...@electricedgesystems.com
wrote:


 Thanks Rob/Russstarting to think I will either do as you both
 suggested and replace # with ## in the AIR app or do as I also mentioned
 and not allow the few characters I'd have issues with (most users don't
 need ~,|,^, or # in comments# being the most likely, but they can
 use No. or Num or Number or pounds or lbs as acceptable
 replacements).

 Sometimes you just have to back away one step from perfect and become
 practical ;-)

 Cheers

 *Bryan Stevenson*B.Comm.
 President  CEO
 Electric Edge Systems Group Inc. - makers of FACTS^(TM)
 phone: 250.480.0642
 cell: 250.920.8830
 e-mail: br...@electricedgesystems.com mailto:
 br...@electricedgesystems.com
 web: www.electricedgesystems.com http://www.electricedgesystems.com
 and www.fisheryfacts.com http://www.fisheryfacts.com

 

 Please consider the environment before printing this e-mail

 -CONFIDENTIALITY--
 This message, including any attachments, is confidential and may contain
 information that is privileged or exempt from disclosure. It is intended
 only for the person to whom it is addressed unless expressly authorized
 otherwise by the sender. If you are not an authorized recipient, please
 notify the sender immediately and permanently destroy all copies of this
 message and attachments.
 On 14-02-07 09:28 AM, Rob Parkhill wrote:
  I thought the #'s were inside the list.  If not and you control the AIR
  app, then just add the replace on the other end, as Russ suggested.
 
 
  On Fri, Feb 7, 2014 at 12:20 PM, Bryan Stevenson 
  br...@electricedgesystems.com wrote:
 
  Thanks Robsorry I should have mentioned that was the first thing I
  tried (ye old double up the #), but the issue seems to be that when a
  variable arrives on CF's door with a single # in it, CF bombs when
  attempting to run the replace.  Now I did say seemsthe way my day
  has goneI will re-test that to make dang sure ;-)
 
  Cheers
 
  On 14-02-07 09:08 AM, Rob Parkhill wrote:
  Run a Replace on the string of data, and change the single # to a
 double
  ##
  that then CF would process as a single one?
 
 
 
 

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357622
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: # in variables

2014-02-07 Thread Jon Clausen

Bryan,

For clarification, how are the comments content being evaluated by CF and 
causing it to choke?  It seems to me that those should be handled as strings 
and that they wouldn’t be evaluated by CF, unless they are wrapped in an 
eval().   If the whole string from a user comment is being evaluated, that 
seems like a possible security issue.  Since you’re dealing with a 
pipe-delimited list, can you migrate them to a variable-safe array with 
listToArray(mypipelist,’|’,true) and process them that way?

It seems to me that a regex replacement of ‘#([^;]*);’ with ‘#chr(\1)#’ should 
allow for the characters to be rendered correctly and then re-run the 
replacement to double # the remaining pound symbols - even if CF is evaluating 
them.

Jon
 
On Feb 7, 2014, at 12:36 PM, Bryan Stevenson br...@electricedgesystems.com 
wrote:

 
 Thanks Rob/Russstarting to think I will either do as you both 
 suggested and replace # with ## in the AIR app or do as I also mentioned 
 and not allow the few characters I'd have issues with (most users don't 
 need ~,|,^, or # in comments# being the most likely, but they can 
 use No. or Num or Number or pounds or lbs as acceptable 
 replacements).
 
 Sometimes you just have to back away one step from perfect and become 
 practical ;-)
 
 Cheers
 
 *Bryan Stevenson*B.Comm.
 President  CEO
 Electric Edge Systems Group Inc. - makers of FACTS^(TM)
 phone: 250.480.0642
 cell: 250.920.8830
 e-mail: br...@electricedgesystems.com mailto:br...@electricedgesystems.com
 web: www.electricedgesystems.com http://www.electricedgesystems.com 
 and www.fisheryfacts.com http://www.fisheryfacts.com
 
 
 
 Please consider the environment before printing this e-mail
 
 -CONFIDENTIALITY--
 This message, including any attachments, is confidential and may contain 
 information that is privileged or exempt from disclosure. It is intended 
 only for the person to whom it is addressed unless expressly authorized 
 otherwise by the sender. If you are not an authorized recipient, please 
 notify the sender immediately and permanently destroy all copies of this 
 message and attachments.
 On 14-02-07 09:28 AM, Rob Parkhill wrote:
 I thought the #'s were inside the list.  If not and you control the AIR
 app, then just add the replace on the other end, as Russ suggested.
 
 
 On Fri, Feb 7, 2014 at 12:20 PM, Bryan Stevenson 
 br...@electricedgesystems.com wrote:
 
 Thanks Robsorry I should have mentioned that was the first thing I
 tried (ye old double up the #), but the issue seems to be that when a
 variable arrives on CF's door with a single # in it, CF bombs when
 attempting to run the replace.  Now I did say seemsthe way my day
 has goneI will re-test that to make dang sure ;-)
 
 Cheers
 
 On 14-02-07 09:08 AM, Rob Parkhill wrote:
 Run a Replace on the string of data, and change the single # to a double
 ##
 that then CF would process as a single one?
 
 
 
 
 
 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357623
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: # in variables

2014-02-07 Thread Adam Cameron

On 7 February 2014 18:07, Jon Clausen jon_clau...@silowebworks.com wrote:


 Bryan,

 For clarification, how are the comments content being evaluated by CF and
 causing it to choke?  It seems to me that those should be handled as
 strings and that they wouldn't be evaluated by CF, unless they are wrapped
 in an eval().


Seconded. I think people are suggesting treating a symptom here, rather
than the problem.

How is this problem of yours manifesting itself? CF chokes on the single
pound in the variable is not a very clear description of what's going
wrong.

Can you pls clarify?

-- 
Adam


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357624
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: # in variables

2014-02-07 Thread Nathan Strutz

My guess is much like Tim Healt's. If you're calling a web service like a
WSDL/SOAP service, the # should be fine. If you're calling it directly via
URL params, like ?method=xargument1=v#riable, the # is a sign to your web
server that the URL params stop there - it's a href hash, which goes to the
browser not the server.

If that's the case, then URL encoding on the client would be necessary. The
bad news is URL encoding may pass on this because # is a valid URL
parameter, just not what you want. In that case, you may have to manually
replace # with %23.

nathan strutz
[www.dopefly.com] [about.me/nathanstrutz]


On Fri, Feb 7, 2014 at 12:14 PM, Adam Cameron dacc...@gmail.com wrote:


 On 7 February 2014 18:07, Jon Clausen jon_clau...@silowebworks.com
 wrote:

 
  Bryan,
 
  For clarification, how are the comments content being evaluated by CF and
  causing it to choke?  It seems to me that those should be handled as
  strings and that they wouldn't be evaluated by CF, unless they are
 wrapped
  in an eval().
 

 Seconded. I think people are suggesting treating a symptom here, rather
 than the problem.

 How is this problem of yours manifesting itself? CF chokes on the single
 pound in the variable is not a very clear description of what's going
 wrong.

 Can you pls clarify?

 --
 Adam


 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357625
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: # in variables

2014-02-07 Thread Bryan Stevenson

Hi All,

Thanks for the additional ideas and requests for clarification - I'm 
stopping this by not allowing a few special characters in the comments...

That said

CF appears to error out when it receives the string of data that 
contains single # or two # separated by string text being confused as a 
CF variable.  It errors out when attempting to run a replace() on the 
entire received string (again I need to double check that is in fact 
what I am seeing).

There is no time that I use eval() on the received data - no worries on 
security issues as was mentioned.

I decided to not allow these few characters because the chance of them 
being used in the context of the application is VERY slimand for the 
one character (#) that has a greater chance of being used, there are 
acceptable alternatives to the use of #. This comments field is 
optional and rarely usedfurther lessening the chances of these 
special characters being entered - just not the hill to die on ;-)

Code is already changed - compiling now ;-)

Have a great weekend everyone - thanks again!

*Bryan Stevenson*B.Comm.
President  CEO
Electric Edge Systems Group Inc. - makers of FACTS^(TM)
phone: 250.480.0642
cell: 250.920.8830
e-mail: br...@electricedgesystems.com mailto:br...@electricedgesystems.com
web: www.electricedgesystems.com http://www.electricedgesystems.com 
and www.fisheryfacts.com http://www.fisheryfacts.com



Please consider the environment before printing this e-mail

-CONFIDENTIALITY--
This message, including any attachments, is confidential and may contain 
information that is privileged or exempt from disclosure. It is intended 
only for the person to whom it is addressed unless expressly authorized 
otherwise by the sender. If you are not an authorized recipient, please 
notify the sender immediately and permanently destroy all copies of this 
message and attachments.


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357626
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Variables, scopes, and referencing, oh my

2012-12-19 Thread Scott Weikert

Lately I've been furiously modifying my main work project codebase, 
going through old (old!) code bits and reworking where I could, to 
modernize (i.e. take advantage of functions/tags that didn't exist back 
in the day) and/or just increase efficiency. I fully expect my keyboard 
to just say I've had enough and commit suicide any time now.

One of the things I've been dealing with is my past slackness re: 
variables and scopes, and the crossing of scopes. I've been tossing in 
Duplicate() around many scope/var bits when, say, setting a particular 
variable in an application scoped structure to equal an unscoped var, or 
a session scoped var.

The idea behind that is (and I'm sure I'm not telling anyone anything 
they don't know) is that a straight up application.var = session.var 
just creates a reference, and doesn't copy by value.

So - when running a particular script that uses variables in the 
app/session scopes, for example, is it all that crucial when going the 
other way? Is going with variables.var = application.var a bad thing, 
considering that application var is *not* likely to go away anytime 
soon? Or is it best practice to still copy by value?

In such a scenario, should that app scope var change in mid-stream for 
whatever reason (unlikely), I assume the variables scope var, being a 
reference, would reflect that change.

Assuming there's zero risk of said app scope var changing/vanishing over 
the execution time of the script, wouldn't the copy-by-reference be just 
a smidge less of a resource usage than copying by value?

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353544
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Loss of variables after switch from application.cfm to application.cfc in FB 3 application

2012-11-09 Thread Nick Gleason

That was perfect Matt.  Thank you.
Nick


Return-Path: listmas...@houseoffusion.com
Received: from mail.houseoffusion.com [64.118.74.225] by 
mail67.safesecureweb.com with SMTP;
   Mon, 5 Nov 2012 15:25:03 -0500
To: cf-talk cf-talk@houseoffusion.com
Message-ID: 
CAKa5oqLv2tFXLzyc2zS=mmu=D3TzGXLE9vEprxisKiOet+S=z...@mail.gmail.com
Subject: Re: Loss of variables after switch from application.cfm to 
application.cfc in FB 3 application
References: 355f13cb$34d4cb1f$54e8dc90$@com
Date: Mon, 5 Nov 2012 14:24:28 -0600
Precedence: bulk
Reply-To: cf-talk@houseoffusion.com
From: Matt Quackenbush quackfu...@gmail.com
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Rcpt-To: n.glea...@citysoft.com
X-SmarterMail-Spam: SpamAssassin 0 [raw: 0], SPF_None, DK_None
X-SmarterMail-TotalSpamWeight: 0 

Just a wild guess here: The file in question is being d and the
variables it is setting are getting set into the Application.cfc's
variables scope, and therefore unavailable elsewhere.

On Mon, Nov 5, 2012 at 2:19 PM, Nick Gleason  wrote:


 Hi folks,
 Bit of a head scratcher here which I'm hoping may be obvious to you all.
 We've got a Fusebox 3 application which we have recently converted from
 application.cfm to application.cfc.
 One puzzling result has been that during a single page request, an
 attributes variable that is set in a file called from application.cfc
 (and formerly from application.cfm) is no longer present once we get 
down
 the line in the code flow to displaying the page.  That is, when we go 
back
 to application.cfm, the variable is available down the line for the page
 display.  But, when application.cfc is used, the variable is available 
when
 it is first called and set, but then has disappeared by the time the 
page
 flow gets to the file where the page display is done.
 So, it seems that some variables in a single request are not as 
persistent
 with application.cfc, at least in a FB 3 context?  That seems surprising
 but I can't really come up with another explanation.  And, so far, we
 haven't been able to figure out exactly where or why the attributes
 variable is getting dropped.
 Any thoughts?
 Nick




 



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353102
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Loss of variables after switch from application.cfm to application.cfc in FB 3 application

2012-11-09 Thread Nick Gleason

Matt, others,
A quick follow up on this.  It seems that request variables have no problem 
persisting if called / set within an application.cfc.  Is that right?
Nick


Return-Path: listmas...@houseoffusion.com
Received: from mail.houseoffusion.com [64.118.74.225] by 
mail67.safesecureweb.com with SMTP;
   Mon, 5 Nov 2012 15:25:03 -0500
To: cf-talk cf-talk@houseoffusion.com
Message-ID: 
CAKa5oqLv2tFXLzyc2zS=mmu=D3TzGXLE9vEprxisKiOet+S=z...@mail.gmail.com
Subject: Re: Loss of variables after switch from application.cfm to 
application.cfc in FB 3 application
References: 355f13cb$34d4cb1f$54e8dc90$@com
Date: Mon, 5 Nov 2012 14:24:28 -0600
Precedence: bulk
Reply-To: cf-talk@houseoffusion.com
From: Matt Quackenbush quackfu...@gmail.com
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Rcpt-To: n.glea...@citysoft.com
X-SmarterMail-Spam: SpamAssassin 0 [raw: 0], SPF_None, DK_None
X-SmarterMail-TotalSpamWeight: 0 

Just a wild guess here: The file in question is being d and the
variables it is setting are getting set into the Application.cfc's
variables scope, and therefore unavailable elsewhere.

On Mon, Nov 5, 2012 at 2:19 PM, Nick Gleason  wrote:


 Hi folks,
 Bit of a head scratcher here which I'm hoping may be obvious to you all.
 We've got a Fusebox 3 application which we have recently converted from
 application.cfm to application.cfc.
 One puzzling result has been that during a single page request, an
 attributes variable that is set in a file called from application.cfc
 (and formerly from application.cfm) is no longer present once we get 
down
 the line in the code flow to displaying the page.  That is, when we go 
back
 to application.cfm, the variable is available down the line for the page
 display.  But, when application.cfc is used, the variable is available 
when
 it is first called and set, but then has disappeared by the time the 
page
 flow gets to the file where the page display is done.
 So, it seems that some variables in a single request are not as 
persistent
 with application.cfc, at least in a FB 3 context?  That seems surprising
 but I can't really come up with another explanation.  And, so far, we
 haven't been able to figure out exactly where or why the attributes
 variable is getting dropped.
 Any thoughts?
 Nick




 


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353103
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Loss of variables after switch from application.cfm to application.cfc in FB 3 application

2012-11-09 Thread Matt Quackenbush

Depending upon where/how they're called/set, that is true. No problem at
all setting/calling request.foo within Application.cfc.


On Thu, Nov 8, 2012 at 7:55 PM, Nick Gleason n.glea...@citysoft.com wrote:


 Matt, others,
 A quick follow up on this.  It seems that request variables have no problem
 persisting if called / set within an application.cfc.  Is that right?
 Nick

 
 Return-Path: listmas...@houseoffusion.com
 Received: from mail.houseoffusion.com [64.118.74.225] by
 mail67.safesecureweb.com with SMTP;
Mon, 5 Nov 2012 15:25:03 -0500
 To: cf-talk cf-talk@houseoffusion.com
 Message-ID:
 CAKa5oqLv2tFXLzyc2zS=mmu=D3TzGXLE9vEprxisKiOet+S=z...@mail.gmail.com
 Subject: Re: Loss of variables after switch from application.cfm to
 application.cfc in FB 3 application
 References: 355f13cb$34d4cb1f$54e8dc90$@com
 Date: Mon, 5 Nov 2012 14:24:28 -0600
 Precedence: bulk
 Reply-To: cf-talk@houseoffusion.com
 From: Matt Quackenbush quackfu...@gmail.com
 MIME-Version: 1.0
 Content-Type: text/plain; charset=ISO-8859-1
 Content-Transfer-Encoding: 7bit
 X-Rcpt-To: n.glea...@citysoft.com
 X-SmarterMail-Spam: SpamAssassin 0 [raw: 0], SPF_None, DK_None
 X-SmarterMail-TotalSpamWeight: 0

 Just a wild guess here: The file in question is being d and the
 variables it is setting are getting set into the Application.cfc's
 variables scope, and therefore unavailable elsewhere.

 On Mon, Nov 5, 2012 at 2:19 PM, Nick Gleason  wrote:

 
  Hi folks,
  Bit of a head scratcher here which I'm hoping may be obvious to you all.
  We've got a Fusebox 3 application which we have recently converted from
  application.cfm to application.cfc.
  One puzzling result has been that during a single page request, an
  attributes variable that is set in a file called from application.cfc
  (and formerly from application.cfm) is no longer present once we get
 down
  the line in the code flow to displaying the page.  That is, when we go
 back
  to application.cfm, the variable is available down the line for the page
  display.  But, when application.cfc is used, the variable is available
 when
  it is first called and set, but then has disappeared by the time the
 page
  flow gets to the file where the page display is done.
  So, it seems that some variables in a single request are not as
 persistent
  with application.cfc, at least in a FB 3 context?  That seems surprising
  but I can't really come up with another explanation.  And, so far, we
  haven't been able to figure out exactly where or why the attributes
  variable is getting dropped.
  Any thoughts?
  Nick
 
 
 




 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353104
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Loss of variables after switch from application.cfm to application.cfc in FB 3 application

2012-11-05 Thread Nick Gleason

Hi folks,
Bit of a head scratcher here which I'm hoping may be obvious to you all.
We've got a Fusebox 3 application which we have recently converted from 
application.cfm to application.cfc.
One puzzling result has been that during a single page request, an 
attributes variable that is set in a file called from application.cfc 
(and formerly from application.cfm) is no longer present once we get down 
the line in the code flow to displaying the page.  That is, when we go back 
to application.cfm, the variable is available down the line for the page 
display.  But, when application.cfc is used, the variable is available when 
it is first called and set, but then has disappeared by the time the page 
flow gets to the file where the page display is done.
So, it seems that some variables in a single request are not as persistent 
with application.cfc, at least in a FB 3 context?  That seems surprising 
but I can't really come up with another explanation.  And, so far, we 
haven't been able to figure out exactly where or why the attributes 
variable is getting dropped.
Any thoughts?
Nick

 


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353065
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Loss of variables after switch from application.cfm to application.cfc in FB 3 application

2012-11-05 Thread Matt Quackenbush

Just a wild guess here: The file in question is being cfincluded and the
variables it is setting are getting set into the Application.cfc's
variables scope, and therefore unavailable elsewhere.


On Mon, Nov 5, 2012 at 2:19 PM, Nick Gleason n.glea...@citysoft.com wrote:


 Hi folks,
 Bit of a head scratcher here which I'm hoping may be obvious to you all.
 We've got a Fusebox 3 application which we have recently converted from
 application.cfm to application.cfc.
 One puzzling result has been that during a single page request, an
 attributes variable that is set in a file called from application.cfc
 (and formerly from application.cfm) is no longer present once we get down
 the line in the code flow to displaying the page.  That is, when we go back
 to application.cfm, the variable is available down the line for the page
 display.  But, when application.cfc is used, the variable is available when
 it is first called and set, but then has disappeared by the time the page
 flow gets to the file where the page display is done.
 So, it seems that some variables in a single request are not as persistent
 with application.cfc, at least in a FB 3 context?  That seems surprising
 but I can't really come up with another explanation.  And, so far, we
 haven't been able to figure out exactly where or why the attributes
 variable is getting dropped.
 Any thoughts?
 Nick




 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353066
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Maximum Post Variables

2012-06-28 Thread Paul Alkema

Hi All,
I'm running into an issue, where when I create over 100 different form elements 
with different content I get a 500 error. I'd like to increase this number up 
from 100 however I can't find an area to do this.

My original thought was that it was in the ColdFusion Administrator -- 
settings -- Maximum size of post data however, when I upped this, it had no 
effect on the number of post variables. I think this setting seems to be the 
post variable size, as like for file uploads ect...

I'm running on ColdFusion 9.0.2 and when I run the code below and hit submit I 
receive an error. Anyone have any ideas?

form action= method=post
cfoutput
cfloop from=1 to=100 index=i
input name=txtBox#i# type=hidden value=txtValue#i# /
/cfloop
/cfoutput
input type=submit name=txtButton /
/form 


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:351760
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Maximum Post Variables

2012-06-28 Thread Paul Alkema

Hi All,
I'm running into an issue, where when I create over 100 different form elements 
with different content I get a 500 error. I'd like to increase this number up 
from 100 however I can't find an area to do this.

My original thought was that it was in the ColdFusion Administrator -- 
settings -- Maximum size of post data however, when I upped this, it had no 
effect on the number of post variables. I think this setting seems to be the 
post variable size, as like for file uploads ect...

I'm running on ColdFusion 9.0.2 and when I run the code below and hit submit I 
receive an error. Anyone have any ideas?

form action= method=post
cfoutput
cfloop from=1 to=100 index=i
input name=txtBox#i# type=hidden value=txtValue#i# /
/cfloop
/cfoutput
input type=submit name=txtButton /
/form 


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:351761
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Maximum Post Variables

2012-06-28 Thread Wil Genovese

There are several blogs that talk about this.  It is a 'setting'

http://www.cutterscrossing.com/index.cfm/2012/3/27/ColdFusion-Security-Hotfix-and-Big-Forms


Here's one.




Wil Genovese
Sr. Web Application Developer/
Systems Administrator
CF Webtools
www.cfwebtools.com

wilg...@trunkful.com
www.trunkful.com

On Jun 29, 2012, at 3:55 PM, Paul Alkema wrote:

 
 Hi All,
 I'm running into an issue, where when I create over 100 different form 
 elements with different content I get a 500 error. I'd like to increase this 
 number up from 100 however I can't find an area to do this.
 
 My original thought was that it was in the ColdFusion Administrator -- 
 settings -- Maximum size of post data however, when I upped this, it had 
 no effect on the number of post variables. I think this setting seems to be 
 the post variable size, as like for file uploads ect...
 
 I'm running on ColdFusion 9.0.2 and when I run the code below and hit submit 
 I receive an error. Anyone have any ideas?
 
 form action= method=post
   cfoutput
cfloop from=1 to=100 index=i
input name=txtBox#i# type=hidden value=txtValue#i# /
/cfloop
/cfoutput
input type=submit name=txtButton /
 /form 
 
 
 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:351762
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Maximum Post Variables

2012-06-28 Thread Carl Von Stetten

Paul,

Take a look at the 9.0.2 release notes: 
http://helpx.adobe.com/coldfusion/release-note/coldfusion-9-0-update-2.html

The Maximum size of post data is for the size (in MB) of posting data 
and/or files in a post request, not the number of parameters allowed in 
a post request.  You'll need to edit the neo-runtime.xml file per the 
release notes to increase the number of parameters allowed.

HTH,
Carl

On 6/29/2012 1:55 PM, Paul Alkema wrote:
 Hi All,
 I'm running into an issue, where when I create over 100 different form 
 elements with different content I get a 500 error. I'd like to increase this 
 number up from 100 however I can't find an area to do this.

 My original thought was that it was in the ColdFusion Administrator -- 
 settings -- Maximum size of post data however, when I upped this, it had 
 no effect on the number of post variables. I think this setting seems to be 
 the post variable size, as like for file uploads ect...

 I'm running on ColdFusion 9.0.2 and when I run the code below and hit submit 
 I receive an error. Anyone have any ideas?

 form action= method=post
   cfoutput
  cfloop from=1 to=100 index=i
  input name=txtBox#i# type=hidden value=txtValue#i# /
  /cfloop
  /cfoutput
  input type=submit name=txtButton /
 /form


 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:351763
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Maximum Post Variables

2012-06-28 Thread Paul Alkema

Hi Wil,
This is exactly what I was looking for. Thanks!!

Paul


 There are several blogs that talk about this.  It is a 'setting'
 
 http://www.cutterscrossing.com/index.
 cfm/2012/3/27/ColdFusion-Security-Hotfix-and-Big-Forms
 
 
 Here's one.
 
 
 
 
 Wil Genovese
 Sr. Web Application Developer/
 Systems Administrator
 CF Webtools
 www.cfwebtools.com
 
 wilg...@trunkful.com
 www.trunkful.com
 
 On Jun 29, 2012, at 3:55 PM, Paul Alkema wrote:
 
  
  Hi All,
  I'm running into an issue, where when I create over 100 different 
 form elements with different content I get a 500 error. I'd like to 
 increase this number up from 100 however I can't find an area to do 
 this.
  
  My original thought was that it was in the ColdFusion Administrator 
 -- settings -- Maximum size of post data however, when I upped 
 this, it had no effect on the number of post variables. I think this 
 setting seems to be the post variable size, as like for file uploads 
 ect...
  
  I'm running on ColdFusion 9.0.2 and when I run the code below and 
 hit submit I receive an error. Anyone have any ideas?
  
  form action= method=post
  cfoutput
 cfloop from=1 to=100 index=i
 input name=txtBox#i# type=hidden value=txtValue#i# 
 /
 /cfloop
 /cfoutput
 input type=submit name=txtButton /
  /form 
  
  
  



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:351764
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Variables

2012-05-16 Thread N kips

Greetings, just need some help to understand how CF works in regards to 
variables. 

Can CF might mix-up the variables, unless the variables are in the session? 

Is this sufficient?

cfset var = GetAuthUser()

or should I say

cfset session.var = GetAuthUser()

It is just a variable that is used to hold data which will be processed, but 
the data is different from user to user. Do not want to process one user's data 
in place of another. 

Appreciate it. 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:351200
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Variables

2012-05-16 Thread Scott Stewart

If it's a local variable in a function, you'll scope it as local.varname
If it's a local variable in a CFM page, you'll scope it as variables.varname

if it's in the request scope, then it's request.varname
if it's in the session, then it's session.varname

application, application.varname
form, form.varname

ad nauseum..

On 5/16/2012 9:26 AM, N kips wrote:
 Greetings, just need some help to understand how CF works in regards to 
 variables.

 Can CF might mix-up the variables, unless the variables are in the session?

 Is this sufficient?

 cfset var = GetAuthUser()

 or should I say

 cfset session.var = GetAuthUser()

 It is just a variable that is used to hold data which will be processed, but 
 the data is different from user to user. Do not want to process one user's 
 data in place of another.

 Appreciate it.

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:351201
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: Variables

2012-05-16 Thread Robert Harrison

If the var is used only within a single program a regular local var is fine.  
If the var needs to persist and be recalled from another program later (i.e., a 
program where the var is not passed as a URL or form value), then use the 
session.var.  

Robert Harrison 
Director of Interactive Services

Austin  Williams
Advertising I Branding I Digital I Direct  
125 Kennedy Drive,  Suite 100   I  Hauppauge, NY 11788
T 631.231.6600 X 119   F 631.434.7022   
http://www.austin-williams.com

Blog:  http://www.austin-williams.com/blog
Twitter:  http://www.twitter.com/austi

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:351202
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Variables

2012-05-16 Thread Cameron Childress

The larger question here is developing an understanding of the scopes
available in ColdFusion and why you would or wouldn't use them. This is a
very fundamental thing that's quite important to understand in order to
develop quality ColdFusion applications. Before continuing I'd recommend
reading the following:

Adobe ColdFusion 9 * Scope types
http://adobe.ly/KfuPoP

Adobe ColdFusion 9 * Using scopes
http://adobe.ly/KfuYsi

Adobe ColdFusion 9 * CFC variables and scope
http://adobe.ly/Kfv5E5

Hope that helps...

-Cameron

On Wed, May 16, 2012 at 9:26 AM, N kips nich...@gmail.com wrote:


 Greetings, just need some help to understand how CF works in regards to
 variables.

 Can CF might mix-up the variables, unless the variables are in the session?

 Is this sufficient?

 cfset var = GetAuthUser()

 or should I say

 cfset session.var = GetAuthUser()

 It is just a variable that is used to hold data which will be processed,
 but the data is different from user to user. Do not want to process one
 user's data in place of another.

 Appreciate it.


-- 
Cameron Childress
--
p:   678.637.5072
im: cameroncf
facebook http://www.facebook.com/cameroncf |
twitterhttp://twitter.com/cameronc |
google+ https://profiles.google.com/u/0/117829379451708140985


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:351203
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Variables

2012-05-16 Thread Carl Von Stetten

Also, be careful using var as a variable name.  It is a reserved 
keyword in ColdFusion.  As Scott mentioned, you can make a variable 
local to a function by calling it local.varname.  You can also make it 
local to a function by using the var keyword when you create the variable:

cfset var foo = bar

HTH,
Carl



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:351206
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: Session variables not working

2012-02-28 Thread Rick Faircloth

Thanks for that reminder... it's been years since
I've even used cflocation! My how knowledge, unused,
is fleeting...

-Original Message-
From: Azadi Saryev [mailto:azadi.sar...@gmail.com] 
Sent: Monday, February 27, 2012 9:20 PM
To: cf-talk
Subject: Re: Session variables not working


In your cflocation tag include addtoken=no attribute to prevent
CFID/CFTOKEN vars from being appended to the url.

I'll also suggest you set your server to use J2EE sessions in CF
Administrator, if you have not done so already.

Azadi

On Tue, Feb 28, 2012 at 04:36, Rick Faircloth r...@whitestonemedia.com
wrote:

 Well, after quickly throwing together an application.cfc,
 I can see that it is necessary.  It attached the CFID
 and CFTOKEN to the URL.


 -Original Message-
 From: Rick Faircloth [mailto:r...@whitestonemedia.com]
 Sent: Monday, February 27, 2012 3:29 PM
 To: cf-talk
 Subject: RE: Session variables not working


 There's no application.cfc at this point...the only
 two pages involved are what's in this email.

 Is enabling session management in an application.cfc
 necessary for session management to work?

 As you can see below when I use:

 cfset session.name = 'rick'

 and then output that with:

 cfoutput#session.name#/cfoutput

 I get 'rick'...

 But that's on the same page.

 Would that work but not session variables between pages
 with session management being enabled in application.cfc?

 Rick

 -Original Message-
 From: Steve Milburn [mailto:scmilb...@gmail.com]
 Sent: Monday, February 27, 2012 3:18 PM
 To: cf-talk
 Subject: Re: Session variables not working


 Have you enabled session management in the application.cfc?

 On Mon, Feb 27, 2012 at 3:14 PM, Rick Faircloth
 r...@whitestonemedia.comwrote:


 It's been awhile since I used session variables,
 but this is simple.  Why won't this work?

 session-test.cfm
 

 cfset session.name = 'rick'

 cfoutput#session.name#/cfoutput

 cflocation url=session-test-2.cfm


 session-test-2.cfm
 --

 cfoutput#session.name#/cfoutput


 I get the error 'Element NAME is undefined in SESSION.'

 ???

 Session variables are specified for use in CFADMIN.
 Am I missing something REALLY simple or obvious?

 Rick









 



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:350125
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: Session variables not working

2012-02-28 Thread Rick Faircloth

I normally use an application.cfc, but this was just a quick
proof-of-concept that I threw together to test something.


-Original Message-
From: James Holmes [mailto:james.hol...@gmail.com] 
Sent: Monday, February 27, 2012 10:56 PM
To: cf-talk
Subject: Re: Session variables not working


Actually, a cfapplication tag will work fine outside of Application.cfm so
technically this isn't true. Of course it makes sense to use
Application.cfm or Application.cfc.

--
Shu Ha Ri: Agile and .NET blog
http://www.bifrost.com.au/


On 28 February 2012 04:36, Russ Michaels r...@michaels.me.uk wrote:


 yes you must have an application.cfm/cfc in order to enable session
 variables.

 On Mon, Feb 27, 2012 at 8:28 PM, Rick Faircloth r...@whitestonemedia.com
 wrote:

 
  There's no application.cfc at this point...the only
  two pages involved are what's in this email.
 
  Is enabling session management in an application.cfc
  necessary for session management to work?
 
  As you can see below when I use:
 
  cfset session.name = 'rick'
 
  and then output that with:
 
  cfoutput#session.name#/cfoutput
 
  I get 'rick'...
 
  But that's on the same page.
 
  Would that work but not session variables between pages
  with session management being enabled in application.cfc?
 
  Rick
 
  -Original Message-
  From: Steve Milburn [mailto:scmilb...@gmail.com]
  Sent: Monday, February 27, 2012 3:18 PM
  To: cf-talk
  Subject: Re: Session variables not working
 
 
  Have you enabled session management in the application.cfc?
 
  On Mon, Feb 27, 2012 at 3:14 PM, Rick Faircloth
  r...@whitestonemedia.comwrote:
 
  
   It's been awhile since I used session variables,
   but this is simple.  Why won't this work?
  
   session-test.cfm
   
  
   cfset session.name = 'rick'
  
   cfoutput#session.name#/cfoutput
  
   cflocation url=session-test-2.cfm
  
  
   session-test-2.cfm
   --
  
   cfoutput#session.name#/cfoutput
  
  
   I get the error 'Element NAME is undefined in SESSION.'
  
   ???
  
   Session variables are specified for use in CFADMIN.
   Am I missing something REALLY simple or obvious?
  
   Rick
  
  
  
  
 
 
 
 

 



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:350126
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: Session variables not working

2012-02-28 Thread Rick Faircloth

Thanks, Jay!

Rick

-Original Message-
From: Jay Pandya [mailto:jaypandy...@gmail.com] 
Sent: Tuesday, February 28, 2012 12:49 AM
To: cf-talk
Subject: Re: Session variables not working


Hi Rick,
When you are using session variables and you want to get its value
in other page after using cflocation then you need to enable seclientcookies
true in cfapplication tag. More description you can read on 
http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Tags_a-b_5
.html
read Setclientcokies description.

Thank You
Jay Pandya
It's been awhile since I used session variables,
but this is simple.  Why won't this work?

session-test.cfm


cfset session.name = 'rick'

cfoutput#session.name#/cfoutput

cflocation url=session-test-2.cfm


session-test-2.cfm
--

cfoutput#session.name#/cfoutput


I get the error 'Element NAME is undefined in SESSION.'

???

Session variables are specified for use in CFADMIN.
Am I missing something REALLY simple or obvious?

Rick 



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:350127
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Session variables not working

2012-02-27 Thread Rick Faircloth

It's been awhile since I used session variables,
but this is simple.  Why won't this work?

session-test.cfm


cfset session.name = 'rick'

cfoutput#session.name#/cfoutput

cflocation url=session-test-2.cfm


session-test-2.cfm
--

cfoutput#session.name#/cfoutput


I get the error 'Element NAME is undefined in SESSION.'

???

Session variables are specified for use in CFADMIN.
Am I missing something REALLY simple or obvious?

Rick



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:350108
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Session variables not working

2012-02-27 Thread Steve Milburn

Have you enabled session management in the application.cfc?

On Mon, Feb 27, 2012 at 3:14 PM, Rick Faircloth r...@whitestonemedia.comwrote:


 It's been awhile since I used session variables,
 but this is simple.  Why won't this work?

 session-test.cfm
 

 cfset session.name = 'rick'

 cfoutput#session.name#/cfoutput

 cflocation url=session-test-2.cfm


 session-test-2.cfm
 --

 cfoutput#session.name#/cfoutput


 I get the error 'Element NAME is undefined in SESSION.'

 ???

 Session variables are specified for use in CFADMIN.
 Am I missing something REALLY simple or obvious?

 Rick



 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:350110
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: Session variables not working

2012-02-27 Thread Rick Faircloth

There's no application.cfc at this point...the only
two pages involved are what's in this email.

Is enabling session management in an application.cfc 
necessary for session management to work?

As you can see below when I use:

cfset session.name = 'rick'

and then output that with:

cfoutput#session.name#/cfoutput

I get 'rick'...

But that's on the same page.

Would that work but not session variables between pages
with session management being enabled in application.cfc?

Rick

-Original Message-
From: Steve Milburn [mailto:scmilb...@gmail.com] 
Sent: Monday, February 27, 2012 3:18 PM
To: cf-talk
Subject: Re: Session variables not working


Have you enabled session management in the application.cfc?

On Mon, Feb 27, 2012 at 3:14 PM, Rick Faircloth
r...@whitestonemedia.comwrote:


 It's been awhile since I used session variables,
 but this is simple.  Why won't this work?

 session-test.cfm
 

 cfset session.name = 'rick'

 cfoutput#session.name#/cfoutput

 cflocation url=session-test-2.cfm


 session-test-2.cfm
 --

 cfoutput#session.name#/cfoutput


 I get the error 'Element NAME is undefined in SESSION.'

 ???

 Session variables are specified for use in CFADMIN.
 Am I missing something REALLY simple or obvious?

 Rick



 



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:350112
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Session variables not working

2012-02-27 Thread Russ Michaels

yes you must have an application.cfm/cfc in order to enable session
variables.

On Mon, Feb 27, 2012 at 8:28 PM, Rick Faircloth r...@whitestonemedia.comwrote:


 There's no application.cfc at this point...the only
 two pages involved are what's in this email.

 Is enabling session management in an application.cfc
 necessary for session management to work?

 As you can see below when I use:

 cfset session.name = 'rick'

 and then output that with:

 cfoutput#session.name#/cfoutput

 I get 'rick'...

 But that's on the same page.

 Would that work but not session variables between pages
 with session management being enabled in application.cfc?

 Rick

 -Original Message-
 From: Steve Milburn [mailto:scmilb...@gmail.com]
 Sent: Monday, February 27, 2012 3:18 PM
 To: cf-talk
 Subject: Re: Session variables not working


 Have you enabled session management in the application.cfc?

 On Mon, Feb 27, 2012 at 3:14 PM, Rick Faircloth
 r...@whitestonemedia.comwrote:

 
  It's been awhile since I used session variables,
  but this is simple.  Why won't this work?
 
  session-test.cfm
  
 
  cfset session.name = 'rick'
 
  cfoutput#session.name#/cfoutput
 
  cflocation url=session-test-2.cfm
 
 
  session-test-2.cfm
  --
 
  cfoutput#session.name#/cfoutput
 
 
  I get the error 'Element NAME is undefined in SESSION.'
 
  ???
 
  Session variables are specified for use in CFADMIN.
  Am I missing something REALLY simple or obvious?
 
  Rick
 
 
 
 



 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:350114
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: Session variables not working

2012-02-27 Thread Rick Faircloth

Well, after quickly throwing together an application.cfc,
I can see that it is necessary.  It attached the CFID
and CFTOKEN to the URL.


-Original Message-
From: Rick Faircloth [mailto:r...@whitestonemedia.com] 
Sent: Monday, February 27, 2012 3:29 PM
To: cf-talk
Subject: RE: Session variables not working


There's no application.cfc at this point...the only
two pages involved are what's in this email.

Is enabling session management in an application.cfc 
necessary for session management to work?

As you can see below when I use:

cfset session.name = 'rick'

and then output that with:

cfoutput#session.name#/cfoutput

I get 'rick'...

But that's on the same page.

Would that work but not session variables between pages
with session management being enabled in application.cfc?

Rick

-Original Message-
From: Steve Milburn [mailto:scmilb...@gmail.com] 
Sent: Monday, February 27, 2012 3:18 PM
To: cf-talk
Subject: Re: Session variables not working


Have you enabled session management in the application.cfc?

On Mon, Feb 27, 2012 at 3:14 PM, Rick Faircloth
r...@whitestonemedia.comwrote:


 It's been awhile since I used session variables,
 but this is simple.  Why won't this work?

 session-test.cfm
 

 cfset session.name = 'rick'

 cfoutput#session.name#/cfoutput

 cflocation url=session-test-2.cfm


 session-test-2.cfm
 --

 cfoutput#session.name#/cfoutput


 I get the error 'Element NAME is undefined in SESSION.'

 ???

 Session variables are specified for use in CFADMIN.
 Am I missing something REALLY simple or obvious?

 Rick



 





~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:350115
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Session variables not working

2012-02-27 Thread Steve Milburn

You will need an application.cfc (or .cfm) for session variables to work.

In your example, your cfset session.name = 'rick' was actually stored in
the variables scope on that page as variables.session.rick, and not
actually in the session scope.  That is why it was not available on the
other page.

On Mon, Feb 27, 2012 at 3:28 PM, Rick Faircloth r...@whitestonemedia.comwrote:


 There's no application.cfc at this point...the only
 two pages involved are what's in this email.

 Is enabling session management in an application.cfc
 necessary for session management to work?

 As you can see below when I use:

 cfset session.name = 'rick'

 and then output that with:

 cfoutput#session.name#/cfoutput

 I get 'rick'...

 But that's on the same page.

 Would that work but not session variables between pages
 with session management being enabled in application.cfc?

 Rick

 -Original Message-
 From: Steve Milburn [mailto:scmilb...@gmail.com]
 Sent: Monday, February 27, 2012 3:18 PM
 To: cf-talk
 Subject: Re: Session variables not working


 Have you enabled session management in the application.cfc?

 On Mon, Feb 27, 2012 at 3:14 PM, Rick Faircloth
 r...@whitestonemedia.comwrote:

 
  It's been awhile since I used session variables,
  but this is simple.  Why won't this work?
 
  session-test.cfm
  
 
  cfset session.name = 'rick'
 
  cfoutput#session.name#/cfoutput
 
  cflocation url=session-test-2.cfm
 
 
  session-test-2.cfm
  --
 
  cfoutput#session.name#/cfoutput
 
 
  I get the error 'Element NAME is undefined in SESSION.'
 
  ???
 
  Session variables are specified for use in CFADMIN.
  Am I missing something REALLY simple or obvious?
 
  Rick
 
 
 
 



 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:350116
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Session variables not working

2012-02-27 Thread Steve Milburn

Correction on my previous post:

The variable was stored in variables.session.name (not
variables.session.rick)...  but you probably knew what I meant.. ;-)



On Mon, Feb 27, 2012 at 3:39 PM, Steve Milburn scmilb...@gmail.com wrote:

 You will need an application.cfc (or .cfm) for session variables to work.

 In your example, your cfset session.name = 'rick' was actually stored
 in the variables scope on that page as variables.session.rick, and not
 actually in the session scope.  That is why it was not available on the
 other page.


 On Mon, Feb 27, 2012 at 3:28 PM, Rick Faircloth 
 r...@whitestonemedia.comwrote:


 There's no application.cfc at this point...the only
 two pages involved are what's in this email.

 Is enabling session management in an application.cfc
 necessary for session management to work?

 As you can see below when I use:

 cfset session.name = 'rick'

 and then output that with:

 cfoutput#session.name#/cfoutput

 I get 'rick'...

 But that's on the same page.

 Would that work but not session variables between pages
 with session management being enabled in application.cfc?

 Rick

 -Original Message-
 From: Steve Milburn [mailto:scmilb...@gmail.com]
 Sent: Monday, February 27, 2012 3:18 PM
 To: cf-talk
 Subject: Re: Session variables not working


 Have you enabled session management in the application.cfc?

 On Mon, Feb 27, 2012 at 3:14 PM, Rick Faircloth
 r...@whitestonemedia.comwrote:

 
  It's been awhile since I used session variables,
  but this is simple.  Why won't this work?
 
  session-test.cfm
  
 
  cfset session.name = 'rick'
 
  cfoutput#session.name#/cfoutput
 
  cflocation url=session-test-2.cfm
 
 
  session-test-2.cfm
  --
 
  cfoutput#session.name#/cfoutput
 
 
  I get the error 'Element NAME is undefined in SESSION.'
 
  ???
 
  Session variables are specified for use in CFADMIN.
  Am I missing something REALLY simple or obvious?
 
  Rick
 
 
 
 



 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:350117
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: Session variables not working

2012-02-27 Thread Rick Faircloth

Thanks for the reminder!

Rick

-Original Message-
From: Steve Milburn [mailto:scmilb...@gmail.com] 
Sent: Monday, February 27, 2012 3:42 PM
To: cf-talk
Subject: Re: Session variables not working


Correction on my previous post:

The variable was stored in variables.session.name (not
variables.session.rick)...  but you probably knew what I meant.. ;-)



On Mon, Feb 27, 2012 at 3:39 PM, Steve Milburn scmilb...@gmail.com wrote:

 You will need an application.cfc (or .cfm) for session variables to work.

 In your example, your cfset session.name = 'rick' was actually stored
 in the variables scope on that page as variables.session.rick, and not
 actually in the session scope.  That is why it was not available on the
 other page.


 On Mon, Feb 27, 2012 at 3:28 PM, Rick Faircloth
r...@whitestonemedia.comwrote:


 There's no application.cfc at this point...the only
 two pages involved are what's in this email.

 Is enabling session management in an application.cfc
 necessary for session management to work?

 As you can see below when I use:

 cfset session.name = 'rick'

 and then output that with:

 cfoutput#session.name#/cfoutput

 I get 'rick'...

 But that's on the same page.

 Would that work but not session variables between pages
 with session management being enabled in application.cfc?

 Rick

 -Original Message-
 From: Steve Milburn [mailto:scmilb...@gmail.com]
 Sent: Monday, February 27, 2012 3:18 PM
 To: cf-talk
 Subject: Re: Session variables not working


 Have you enabled session management in the application.cfc?

 On Mon, Feb 27, 2012 at 3:14 PM, Rick Faircloth
 r...@whitestonemedia.comwrote:

 
  It's been awhile since I used session variables,
  but this is simple.  Why won't this work?
 
  session-test.cfm
  
 
  cfset session.name = 'rick'
 
  cfoutput#session.name#/cfoutput
 
  cflocation url=session-test-2.cfm
 
 
  session-test-2.cfm
  --
 
  cfoutput#session.name#/cfoutput
 
 
  I get the error 'Element NAME is undefined in SESSION.'
 
  ???
 
  Session variables are specified for use in CFADMIN.
  Am I missing something REALLY simple or obvious?
 
  Rick
 
 
 
 



 



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:350119
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Session variables not working

2012-02-27 Thread Azadi Saryev

In your cflocation tag include addtoken=no attribute to prevent
CFID/CFTOKEN vars from being appended to the url.

I'll also suggest you set your server to use J2EE sessions in CF
Administrator, if you have not done so already.

Azadi

On Tue, Feb 28, 2012 at 04:36, Rick Faircloth r...@whitestonemedia.com wrote:

 Well, after quickly throwing together an application.cfc,
 I can see that it is necessary.  It attached the CFID
 and CFTOKEN to the URL.


 -Original Message-
 From: Rick Faircloth [mailto:r...@whitestonemedia.com]
 Sent: Monday, February 27, 2012 3:29 PM
 To: cf-talk
 Subject: RE: Session variables not working


 There's no application.cfc at this point...the only
 two pages involved are what's in this email.

 Is enabling session management in an application.cfc
 necessary for session management to work?

 As you can see below when I use:

 cfset session.name = 'rick'

 and then output that with:

 cfoutput#session.name#/cfoutput

 I get 'rick'...

 But that's on the same page.

 Would that work but not session variables between pages
 with session management being enabled in application.cfc?

 Rick

 -Original Message-
 From: Steve Milburn [mailto:scmilb...@gmail.com]
 Sent: Monday, February 27, 2012 3:18 PM
 To: cf-talk
 Subject: Re: Session variables not working


 Have you enabled session management in the application.cfc?

 On Mon, Feb 27, 2012 at 3:14 PM, Rick Faircloth
 r...@whitestonemedia.comwrote:


 It's been awhile since I used session variables,
 but this is simple.  Why won't this work?

 session-test.cfm
 

 cfset session.name = 'rick'

 cfoutput#session.name#/cfoutput

 cflocation url=session-test-2.cfm


 session-test-2.cfm
 --

 cfoutput#session.name#/cfoutput


 I get the error 'Element NAME is undefined in SESSION.'

 ???

 Session variables are specified for use in CFADMIN.
 Am I missing something REALLY simple or obvious?

 Rick









 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:350120
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Session variables not working

2012-02-27 Thread James Holmes

Actually, a cfapplication tag will work fine outside of Application.cfm so
technically this isn't true. Of course it makes sense to use
Application.cfm or Application.cfc.

--
Shu Ha Ri: Agile and .NET blog
http://www.bifrost.com.au/


On 28 February 2012 04:36, Russ Michaels r...@michaels.me.uk wrote:


 yes you must have an application.cfm/cfc in order to enable session
 variables.

 On Mon, Feb 27, 2012 at 8:28 PM, Rick Faircloth r...@whitestonemedia.com
 wrote:

 
  There's no application.cfc at this point...the only
  two pages involved are what's in this email.
 
  Is enabling session management in an application.cfc
  necessary for session management to work?
 
  As you can see below when I use:
 
  cfset session.name = 'rick'
 
  and then output that with:
 
  cfoutput#session.name#/cfoutput
 
  I get 'rick'...
 
  But that's on the same page.
 
  Would that work but not session variables between pages
  with session management being enabled in application.cfc?
 
  Rick
 
  -Original Message-
  From: Steve Milburn [mailto:scmilb...@gmail.com]
  Sent: Monday, February 27, 2012 3:18 PM
  To: cf-talk
  Subject: Re: Session variables not working
 
 
  Have you enabled session management in the application.cfc?
 
  On Mon, Feb 27, 2012 at 3:14 PM, Rick Faircloth
  r...@whitestonemedia.comwrote:
 
  
   It's been awhile since I used session variables,
   but this is simple.  Why won't this work?
  
   session-test.cfm
   
  
   cfset session.name = 'rick'
  
   cfoutput#session.name#/cfoutput
  
   cflocation url=session-test-2.cfm
  
  
   session-test-2.cfm
   --
  
   cfoutput#session.name#/cfoutput
  
  
   I get the error 'Element NAME is undefined in SESSION.'
  
   ???
  
   Session variables are specified for use in CFADMIN.
   Am I missing something REALLY simple or obvious?
  
   Rick
  
  
  
  
 
 
 
 

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:350121
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Session variables not working

2012-02-27 Thread Jay Pandya

Hi Rick,
When you are using session variables and you want to get its value in 
other page after using cflocation then you need to enable seclientcookies true 
in cfapplication tag. More description you can read on 
http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Tags_a-b_5.html
read Setclientcokies description.

Thank You
Jay Pandya
It's been awhile since I used session variables,
but this is simple.  Why won't this work?

session-test.cfm


cfset session.name = 'rick'

cfoutput#session.name#/cfoutput

cflocation url=session-test-2.cfm


session-test-2.cfm
--

cfoutput#session.name#/cfoutput


I get the error 'Element NAME is undefined in SESSION.'

???

Session variables are specified for use in CFADMIN.
Am I missing something REALLY simple or obvious?

Rick 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:350123
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Opinion: Abuse of session variables

2012-02-03 Thread Cameron Childress

On Thu, Feb 2, 2012 at 10:22 AM, Raymond Camden raymondcam...@gmail.com
 wrote:

 I'd also argue that sometimes race conditions may not matter.


On project I've worked on, this is true 99.9% of the time.


 Consider a session variable that tracks the # of pages you have viewed
 in your session. If I pop open a new tab and start reloading them both
 like crazy, it's possible the values may end up borked. But do we
 care? No. If it's just a simple stat and it's not perfect, then I'd
 ignore the hassle of locking the write/reads.


...and this is a pretty unusual use case with all the analytics packages
out there. Really, I have a pretty hard time thinking of a good use case
with race conditions that goes beyond a contrived impractical example.

Banking maybe?  Though in most cases I'd going to be doing much of that
type of work in the DB and even if I'm not, it's probably going to be in a
scope that doesn't live past a single request.

Most of the examples I see are things that shouldn't be using the Session
scope at all anyway.

Of course, folks are free write their apps any way they want, but I just
don't see it as a problem.  I very very very rarely lock (or have need to
lock) session vars. I don't think I've  personally found reason in any
project I've worked on since CF5.

-Cameron

-- 
Cameron Childress
--
p:   678.637.5072
im: cameroncf
facebook http://www.facebook.com/cameroncf |
twitterhttp://twitter.com/cameronc |
google+ https://profiles.google.com/u/0/117829379451708140985

...


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349765
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Opinion: Abuse of session variables

2012-02-03 Thread Dave Watts

 ...and this is a pretty unusual use case with all the analytics packages
 out there. Really, I have a pretty hard time thinking of a good use case
 with race conditions that goes beyond a contrived impractical example.

Someone on cf-talk had a race condition just last week, around their
authentication process. Of course, it was because of how their code
was structured, and probably didn't need CFLOCK to resolve.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349766
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Opinion: Abuse of session variables

2012-02-03 Thread Cameron Childress

On Fri, Feb 3, 2012 at 11:03 AM, Dave Watts dwa...@figleaf.com wrote:

  ...and this is a pretty unusual use case with all the analytics packages
  out there. Really, I have a pretty hard time thinking of a good use case
  with race conditions that goes beyond a contrived impractical example.

 Someone on cf-talk had a race condition just last week, around their
 authentication process. Of course, it was because of how their code
 was structured, and probably didn't need CFLOCK to resolve.


Race conditions certainly exist.  Specifically though, race conditions
involving session variables which can be resolved using CFLOCK, are
relatively uncommon.

In my personal experience anyway...

-Cameron

-- 
Cameron Childress
--
p:   678.637.5072
im: cameroncf
facebook http://www.facebook.com/cameroncf |
twitterhttp://twitter.com/cameronc |
google+ https://profiles.google.com/u/0/117829379451708140985


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349767
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Opinion: Abuse of session variables

2012-02-03 Thread Dave Watts

   ...and this is a pretty unusual use case with all the analytics packages
   out there. Really, I have a pretty hard time thinking of a good use case
   with race conditions that goes beyond a contrived impractical example.
 
  Someone on cf-talk had a race condition just last week, around their
  authentication process. Of course, it was because of how their code
  was structured, and probably didn't need CFLOCK to resolve.

 Race conditions certainly exist.  Specifically though, race conditions
 involving session variables which can be resolved using CFLOCK, are
 relatively uncommon.

 In my personal experience anyway...

I'm not sure I'm disagreeing with you. Most race conditions that I see
can be resolved without CFLOCK, but not all - specifically around
components used during authentication/user initialization/etc. The
primary reason for them seems to be that developers just don't think
about concurrency.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349768
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Opinion: Abuse of session variables

2012-02-03 Thread Mary Jo Sminkey

Race conditions certainly exist.  Specifically though, race conditions
involving session variables which can be resolved using CFLOCK, are
relatively uncommon.

In my personal experience anyway...

+! 

In my experience anything that would really be effected by race conditions 
shouldn't be in session scope to begin with.


Mary Jo 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349769
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Opinion: Abuse of session variables

2012-02-03 Thread Cameron Childress

On Fri, Feb 3, 2012 at 12:10 PM, Dave Watts dwa...@figleaf.com wrote:

 I'm not sure I'm disagreeing with you. Most race conditions that I see
 can be resolved without CFLOCK, but not all - specifically around
 components used during authentication/user initialization/etc. The
 primary reason for them seems to be that developers just don't think
 about concurrency.


Agreed.

-Cameron

-- 
Cameron Childress
--
p:   678.637.5072
im: cameroncf
facebook http://www.facebook.com/cameroncf |
twitterhttp://twitter.com/cameronc |
google+ https://profiles.google.com/u/0/117829379451708140985


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349771
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Opinion: Abuse of session variables

2012-02-02 Thread Cameron Childress

On Wed, Feb 1, 2012 at 7:37 PM, James Holmes james.hol...@gmail.com wrote:

 Race conditions in session variables can only occur when two requests from
 the same session execute concurrently. This is more likely with ajax
 requests or framesets. Since everyone uses ajax requests these days (even
 though no-one uses framesets any more), it is still an issue, as you say.


This can be true, depending on the situation and how you are using the
session scope.

However, untrue is the old adage of always lock your session variables.

-Cameron

-- 
Cameron Childress
--
p:   678.637.5072
im: cameroncf
facebook http://www.facebook.com/cameroncf |
twitterhttp://twitter.com/cameronc |
google+ https://profiles.google.com/u/0/117829379451708140985


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349743
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Opinion: Abuse of session variables

2012-02-02 Thread Raymond Camden

I'd also argue that sometimes race conditions may not matter.

Consider a session variable that tracks the # of pages you have viewed
in your session. If I pop open a new tab and start reloading them both
like crazy, it's possible the values may end up borked. But do we
care? No. If it's just a simple stat and it's not perfect, then I'd
ignore the hassle of locking the write/reads.

On Thu, Feb 2, 2012 at 7:11 AM, Cameron Childress camer...@gmail.com wrote:

 On Wed, Feb 1, 2012 at 7:37 PM, James Holmes james.hol...@gmail.com wrote:

 Race conditions in session variables can only occur when two requests from
 the same session execute concurrently. This is more likely with ajax
 requests or framesets. Since everyone uses ajax requests these days (even
 though no-one uses framesets any more), it is still an issue, as you say.


 This can be true, depending on the situation and how you are using the
 session scope.

 However, untrue is the old adage of always lock your session variables.

 -Cameron

 --
 Cameron Childress
 --
 p:   678.637.5072
 im: cameroncf
 facebook http://www.facebook.com/cameroncf |
 twitterhttp://twitter.com/cameronc |
 google+ https://profiles.google.com/u/0/117829379451708140985


 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349745
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Opinion: Abuse of session variables

2012-02-02 Thread Russ Michaels

of course for a newbie that has no idea what a race condition is, in todays
PC society they might take that as an insult :-)

On Thu, Feb 2, 2012 at 3:22 PM, Raymond Camden raymondcam...@gmail.comwrote:


 I'd also argue that sometimes race conditions may not matter.

 Consider a session variable that tracks the # of pages you have viewed
 in your session. If I pop open a new tab and start reloading them both
 like crazy, it's possible the values may end up borked. But do we
 care? No. If it's just a simple stat and it's not perfect, then I'd
 ignore the hassle of locking the write/reads.

 On Thu, Feb 2, 2012 at 7:11 AM, Cameron Childress camer...@gmail.com
 wrote:
 
  On Wed, Feb 1, 2012 at 7:37 PM, James Holmes james.hol...@gmail.com
 wrote:
 
  Race conditions in session variables can only occur when two requests
 from
  the same session execute concurrently. This is more likely with ajax
  requests or framesets. Since everyone uses ajax requests these days
 (even
  though no-one uses framesets any more), it is still an issue, as you
 say.
 
 
  This can be true, depending on the situation and how you are using the
  session scope.
 
  However, untrue is the old adage of always lock your session variables.
 
  -Cameron
 
  --
  Cameron Childress
  --
  p:   678.637.5072
  im: cameroncf
  facebook http://www.facebook.com/cameroncf |
  twitterhttp://twitter.com/cameronc |
  google+ https://profiles.google.com/u/0/117829379451708140985
 
 
 

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349752
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Opinion: Abuse of session variables

2012-02-01 Thread Russ Michaels

in the case I was referring to Dave, there was no locking, and it was
copying all scopes into sessions (variables, url and form) and then back
again
so it really was for no good reason :-)
however all programmers work different and have a tendency to slate the way
others have done things, thus why I suggested it would be better to just
ask him rather than make assumptions.Most of time we don;t have this option
as the original developer has long since gone.

On Wed, Feb 1, 2012 at 3:58 AM, Dave Watts dwa...@figleaf.com wrote:


  I have come across some similar code also, moving variables scope into
  sessions and back again for no reason.

 There's actually a reason why that might be, in some cases. Not a good
 reason, but a reason nonetheless. It used to be the case (CF 5 and
 earlier) that you had to worry about locking a lot more than you do
 now. So, people would do something like this:

 !-- top of page --
 cflock scope=session ...
 cfset variables.localsession = session
 /cflock

 ... do a bunch of stuff with those variables ...

 !-- bottom of page --
 cflock scope=session ...
 cfset session = variables.localsession
 /cflock

 Unfortunately, it didn't work very well in practice.

  perhaps you could just ask him why he is doing it.

 I am not being sarcastic when I say this - this is a very good suggestion.

 Dave Watts, CTO, Fig Leaf Software
 http://www.figleaf.com/
 http://training.figleaf.com/

 Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
 GSA Schedule, and provides the highest caliber vendor-authorized
 instruction at our training centers, online, or onsite.

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349694
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Opinion: Abuse of session variables

2012-02-01 Thread Mike Chabot

I would agree with what some others have written, in that an apparent
over-use of session variables is not inherently bad, unless it is
causing server instability or memory problems. Make sure the
programmer is using session variables for a specific reason, and that
he is aware of the issues that using session variables can cause. Out
of all the faults one can find when examining a Web site, using too
many session variables is fairly low on the priority list. 1000 users
on a site at a time with 250 session variables per user doesn't seem
that bad to me on the surface. Storing frequently accessed database
data in the session scope is often used as a caching optimization
technique to reduce the database bottleneck. It is a technique I use
and recommend, especially for very busy Web applications. In general,
the busier the Web application, the more you are going to want to
store in-memory to reduce the database usage, assuming your server has
sufficient RAM. Really giant Web sites, like Facebook and YouTube,
make extensive use of in-memory databases, like memcached.
http://en.wikipedia.org/wiki/Memcached

One thing most developers neglect to do when using lots of session
variables is making the session code thread safe, which takes a
relatively high skill and experience level to accomplish. Unless you
see a lot of cflock tags to mitigate the possible problems, a site
with 1000 simultaneous users and 250 session variables might have
random problems that could be traced back to the use of session
variables. Threading problems can be hard to diagnose and are usually
not discovered until the code gets put into a production environment.

If the programmer is aware of the memory usage and threading issues,
using lots of session variables is likely a minor concern, and
potentially is a good thing if he is using them as a technique to
speed up the Web application.

You wrote I see no scope referencing in these Vars, which I find odd
if you are referring to variables in the session scope. All the
in-memory variables should have their scope referenced when they are
used.

-Mike Chabot

On Tue, Jan 31, 2012 at 11:37 AM, Robert Harrison
rob...@austin-williams.com wrote:

 Thanks for all the input.  Besides the fact that the application could 
 conceivably have hundreds of thousands of session Vars in memory, I'm 
 concerned about collision too.

 I see no scope referencing in these Vars and see they are all 'common names'. 
 I also see no routines to clear any vars after completion of an operation is 
 over.

 Oh well.

 Robert B. Harrison
 Director of Interactive Services
 Austin  Williams
 125 Kennedy Drive, Suite 100
 Hauppauge NY 11788
 P : 631.231.6600 Ext. 119
 F : 631.434.7022
 http://www.austin-williams.co

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349723
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Opinion: Abuse of session variables

2012-02-01 Thread Cameron Childress

On Wed, Feb 1, 2012 at 1:55 PM, Mike Chabot mcha...@gmail.com wrote:

 One thing most developers neglect to do when using lots of session
 variables is making the session code thread safe, which takes a
 relatively high skill and experience level to accomplish. Unless you
 see a lot of cflock tags to mitigate the possible problems, a site
 with 1000 simultaneous users and 250 session variables might have
 random problems that could be traced back to the use of session
 variables.


This is largely false since the release of CF6. Race conditions being the
primary exception.

-Cameron

...


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349724
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Opinion: Abuse of session variables

2012-02-01 Thread Russ Michaels

Fyi cf officially did away with need for manual locking some time ago. The
only sitation where you need to lock now is where you have potential race
conditions. Some folks still like to lock anyway though.

Regards
Russ Michaels
From my mobile
On 1 Feb 2012 18:57, Mike Chabot mcha...@gmail.com wrote:


 I would agree with what some others have written, in that an apparent
 over-use of session variables is not inherently bad, unless it is
 causing server instability or memory problems. Make sure the
 programmer is using session variables for a specific reason, and that
 he is aware of the issues that using session variables can cause. Out
 of all the faults one can find when examining a Web site, using too
 many session variables is fairly low on the priority list. 1000 users
 on a site at a time with 250 session variables per user doesn't seem
 that bad to me on the surface. Storing frequently accessed database
 data in the session scope is often used as a caching optimization
 technique to reduce the database bottleneck. It is a technique I use
 and recommend, especially for very busy Web applications. In general,
 the busier the Web application, the more you are going to want to
 store in-memory to reduce the database usage, assuming your server has
 sufficient RAM. Really giant Web sites, like Facebook and YouTube,
 make extensive use of in-memory databases, like memcached.
 http://en.wikipedia.org/wiki/Memcached

 One thing most developers neglect to do when using lots of session
 variables is making the session code thread safe, which takes a
 relatively high skill and experience level to accomplish. Unless you
 see a lot of cflock tags to mitigate the possible problems, a site
 with 1000 simultaneous users and 250 session variables might have
 random problems that could be traced back to the use of session
 variables. Threading problems can be hard to diagnose and are usually
 not discovered until the code gets put into a production environment.

 If the programmer is aware of the memory usage and threading issues,
 using lots of session variables is likely a minor concern, and
 potentially is a good thing if he is using them as a technique to
 speed up the Web application.

 You wrote I see no scope referencing in these Vars, which I find odd
 if you are referring to variables in the session scope. All the
 in-memory variables should have their scope referenced when they are
 used.

 -Mike Chabot

 On Tue, Jan 31, 2012 at 11:37 AM, Robert Harrison
 rob...@austin-williams.com wrote:
 
  Thanks for all the input.  Besides the fact that the application could
 conceivably have hundreds of thousands of session Vars in memory, I'm
 concerned about collision too.
 
  I see no scope referencing in these Vars and see they are all 'common
 names'. I also see no routines to clear any vars after completion of an
 operation is over.
 
  Oh well.
 
  Robert B. Harrison
  Director of Interactive Services
  Austin  Williams
  125 Kennedy Drive, Suite 100
  Hauppauge NY 11788
  P : 631.231.6600 Ext. 119
  F : 631.434.7022
  http://www.austin-williams.co

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349725
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Opinion: Abuse of session variables

2012-02-01 Thread Mike Chabot

Race conditions are what I am referring to and they are a problem,
even in CF9. Many developers either heard or read that the earlier
problems with session variables have been fixed and that they no
longer need to ever lock them, but this is not true. It is one of the
most common CF misconceptions, even among experienced CF programmers.
The problem generally only shows up on high-traffic data intensive
sites, but even with 1000 simultaneous users and 250 session variables
I would expect that the application will at some point have a
seemingly random and rare issue when updating large structures of
session variables or processing giant form submissions that could
ultimately be traced back to a race condition where competing code
execution process are accessing the same shared resource on different
threads. The cflock tag still exists, and it is usually not used as
frequently as it needs to be used, which is why I mentioned the
problem. The use of the cflock tag is not simply a matter of
preference. It solves an actual problem related to the multi-threaded
code accessing shared resources, such as session variables.

From the CF9 manual:
ColdFusion lets you lock access to sections of code to ensure that
ColdFusion does not attempt to run the code, or access the data that
it uses, simultaneously or in an unpredictable order. This locking
feature is important for ensuring the consistency of all shared data,
including data in external sources in addition to data in persistent
scopes.

I think many developers would prefer to ignore the issue because
locking isn't fun and race conditions are a challenging issue to
understand.

-Mike Chabot

On Wed, Feb 1, 2012 at 3:03 PM, Cameron Childress camer...@gmail.com wrote:
 This is largely false since the release of CF6. Race conditions being the
 primary exception.

 -Cameron

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349728
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Opinion: Abuse of session variables

2012-02-01 Thread James Holmes

Race conditions in session variables can only occur when two requests from
the same session execute concurrently. This is more likely with ajax
requests or framesets. Since everyone uses ajax requests these days (even
though no-one uses framesets any more), it is still an issue, as you say.
--
Shu Ha Ri: Agile and .NET blog
http://www.bifrost.com.au/


On 2 February 2012 05:53, Mike Chabot mcha...@gmail.com wrote:


 Race conditions are what I am referring to and they are a problem,
 even in CF9. Many developers either heard or read that the earlier
 problems with session variables have been fixed and that they no
 longer need to ever lock them, but this is not true.


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349733
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Opinion: Abuse of session variables

2012-02-01 Thread Mike Chabot

In addition to AJAX (and Flex/Flash remoting calls) and framesets (and
iframes), issues with session variables can also occur if a user has
two separate browser tabs open, double clicks links or form submit
buttons (some users double click everything), rapidly and repeatedly
presses a submit button or the refresh button because a page is slow
to load, submits a form, then makes a quick change before the form
disappears from the screen, and submits again, requests a page but
presses the browser back button before the page loads, rapidly toggles
through multiple pages using a fast-loading navigation element
(possibly controlled by a URL variable), starts running a page that
takes so long to process that they hit the browser timeout before the
code finishes processing, so they run it again, and likely some other
scenarios.

-Mike Chabot

On Wed, Feb 1, 2012 at 7:37 PM, James Holmes james.hol...@gmail.com wrote:

 Race conditions in session variables can only occur when two requests from
 the same session execute concurrently. This is more likely with ajax
 requests or framesets. Since everyone uses ajax requests these days (even
 though no-one uses framesets any more), it is still an issue, as you say.
 --
 Shu Ha Ri: Agile and .NET blog
 http://www.bifrost.com.au/


 On 2 February 2012 05:53, Mike Chabot mcha...@gmail.com wrote:


 Race conditions are what I am referring to and they are a problem,
 even in CF9. Many developers either heard or read that the earlier
 problems with session variables have been fixed and that they no
 longer need to ever lock them, but this is not true.


 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349736
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Opinion: Abuse of session variables

2012-01-31 Thread Robert Harrison

I'm an old school programmer who watches every bit and byte and really 
practices resource management in my coding practices.

I've got a new programmer working for me (on contract) and I'm finding he's 
using session Vars all over the place. He creating session Vars on forms that 
have a hundred fields, he putting arrays into session Vars, etc. I just went 
through a few of the programs he wrote and used them, then I dumped my session 
vars and found I had over 250 session vars from just using a few programs. 
Considering the site has over 1,000 users on it at any given moment, I'm very 
concerned about this practice.

Am I nuts, or is this just bad?

Thanks,
Robert

Robert B. Harrison
Director of Interactive Services
Austin  Williams
125 Kennedy Drive, Suite 100 
Hauppauge NY 11788
P : 631.231.6600 Ext. 119 
F : 631.434.7022
http://www.austin-williams.com 

Great advertising can't be either/or.  It must be .

Plug in to our blog: AW Unplugged
http://www.austin-williams.com/unplugged

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349680
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Opinion: Abuse of session variables

2012-01-31 Thread Matt Quackenbush

It depends.

It could be no big deal, but it definitely sounds like there is a
significant risk of oops! there goes the server!. As a general rule, you
are correct: keep the session as lean as possible. More specifically, don't
use it unless there is a damn good reason to do so.

Maybe it's time to have a best practices or our standards are: type of
conversation.

HTH


On Tue, Jan 31, 2012 at 10:01 AM, Robert Harrison 
rob...@austin-williams.com wrote:


 I'm an old school programmer who watches every bit and byte and really
 practices resource management in my coding practices.

 I've got a new programmer working for me (on contract) and I'm finding
 he's using session Vars all over the place. He creating session Vars on
 forms that have a hundred fields, he putting arrays into session Vars, etc.
 I just went through a few of the programs he wrote and used them, then I
 dumped my session vars and found I had over 250 session vars from just
 using a few programs. Considering the site has over 1,000 users on it at
 any given moment, I'm very concerned about this practice.

 Am I nuts, or is this just bad?

 Thanks,
 Robert

 Robert B. Harrison
 Director of Interactive Services
 Austin  Williams
 125 Kennedy Drive, Suite 100
 Hauppauge NY 11788
 P : 631.231.6600 Ext. 119
 F : 631.434.7022
 http://www.austin-williams.com

 Great advertising can't be either/or.  It must be .

 Plug in to our blog: AW Unplugged
 http://www.austin-williams.com/unplugged

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349681
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Opinion: Abuse of session variables

2012-01-31 Thread Jochem van Dieten

On Tue, Jan 31, 2012 at 5:01 PM, Robert Harrison
rob...@austin-williams.com wrote:
 I've got a new programmer working for me (on contract) and I'm finding he's 
 using session Vars all over the place. He creating session Vars on forms that 
 have a hundred fields, he putting arrays into session Vars, etc. I just went 
 through a few of the programs he wrote and used them, then I dumped my 
 session vars and found I had over 250 session vars from just using a few 
 programs. Considering the site has over 1,000 users on it at any given 
 moment, I'm very concerned about this practice.

Your primary concern should not be the memory usage implications of
this practice, but the functional implications. What does it mean for
the correctness of your application? Can you still navigate the site
with multiple tabs opened if everything goes into the session scope or
do you get weird results on some pages because session variables get
overwritten from elsewhere?

Only after you are certain the code is functionally correct memory
optimizations come into play

Jochem


-- 
Jochem van Dieten
http://jochem.vandieten.net/

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349682
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Opinion: Abuse of session variables

2012-01-31 Thread Alan Rother

As a general rule in life, I believe, everything in moderation - The
extremes on either side will always get you into trouble.

Modern servers have tons of RAM, session vars, especially vars that are
just strings, are pretty light weight. It's hard to imagine making common
senses use of them causing issues with the server. However, on the other
side, if you got a guy storing every moment of every customer interaction
in a session struct, you've got the definite potential for problems.

Based on what you've told us, it sounds like this guy might have
some architectural problems in his designs for you apps. I'd start with him
by going over the realistic use cases for the data he is storing.

It's likely he has a good reason for storing huge forms in the
session(there are plenty of reasons to do that) - but maybe you
need to look at how long those vals need to be persisted - if they need to
be, I'd move them to a temp database and just carry a reference to the vals
in the DB in their session.

=]

-- 
Alan Rother
Manager, Phoenix Cold Fusion User Group, www.AZCFUG.org
Twitter: @AlanRother


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349683
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Opinion: Abuse of session variables

2012-01-31 Thread Cameron Childress

I generally would keep the variable as long as you need it and no longer.
 If it's just needed for the request, there is no reason at all it should
be in the session scope.  Performance is a concern, but so is data leaking
from page to page.  If you're putting alot in session and not paying
attention to the names then you may end up stepping on variables as you go.

At the least, if they are needed for a multipart form (for example) then he
should be clearing (structDelete()) the variables when they are no longer
needed.  Better yet, put then in a struct in session and just nuke that
struct when you're done with it.  IF you have:

session.myform.firstname
session.myform.lastname
session.myform.phone

Then when you are done just do a little structDelete(session,'myform')
action and your session is all clean again.

-Cameron

On Tue, Jan 31, 2012 at 11:01 AM, Robert Harrison 
rob...@austin-williams.com wrote:


 I'm an old school programmer who watches every bit and byte and really
 practices resource management in my coding practices.

 I've got a new programmer working for me (on contract) and I'm finding
 he's using session Vars all over the place. He creating session Vars on
 forms that have a hundred fields, he putting arrays into session Vars, etc.
 I just went through a few of the programs he wrote and used them, then I
 dumped my session vars and found I had over 250 session vars from just
 using a few programs. Considering the site has over 1,000 users on it at
 any given moment, I'm very concerned about this practice.

 Am I nuts, or is this just bad?

 Thanks,
 Robert

 Robert B. Harrison
 Director of Interactive Services
 Austin  Williams
 125 Kennedy Drive, Suite 100
 Hauppauge NY 11788
 P : 631.231.6600 Ext. 119
 F : 631.434.7022
 http://www.austin-williams.com

 Great advertising can't be either/or.  It must be .

 Plug in to our blog: AW Unplugged
 http://www.austin-williams.com/unplugged

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349684
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: Opinion: Abuse of session variables

2012-01-31 Thread Robert Harrison

Thanks for all the input.  Besides the fact that the application could 
conceivably have hundreds of thousands of session Vars in memory, I'm concerned 
about collision too. 

I see no scope referencing in these Vars and see they are all 'common names'. I 
also see no routines to clear any vars after completion of an operation is 
over. 

Oh well. 

Robert B. Harrison
Director of Interactive Services
Austin  Williams
125 Kennedy Drive, Suite 100 
Hauppauge NY 11788
P : 631.231.6600 Ext. 119 
F : 631.434.7022
http://www.austin-williams.com 

Great advertising can't be either/or.  It must be .

Plug in to our blog: AW Unplugged
http://www.austin-williams.com/unplugged


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349685
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Opinion: Abuse of session variables

2012-01-31 Thread Maureen

I think I ran across that guy once (lol).  IMO, loading anything other
the absolute minimum required info to identify a unique session into
session variables is bad coding practice.

On Tue, Jan 31, 2012 at 8:01 AM, Robert Harrison
rob...@austin-williams.com wrote:

 I'm an old school programmer who watches every bit and byte and really 
 practices resource management in my coding practices.

 I've got a new programmer working for me (on contract) and I'm finding he's 
 using session Vars all over the place. He creating session Vars on forms that 
 have a hundred fields, he putting arrays into session Vars, etc. I just went 
 through a few of the programs he wrote and used them, then I dumped my 
 session vars and found I had over 250 session vars from just using a few 
 programs. Considering the site has over 1,000 users on it at any given 
 moment, I'm very concerned about this practice.

 Am I nuts, or is this just bad?

 Thanks,
 Robert

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349687
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Opinion: Abuse of session variables

2012-01-31 Thread Russ Michaels

I have come across some similar code also, moving variables scope into
sessions and back again for no reason.
if the data has no reason to persist past the request then there is no
reason to put it in session scope.
the primary reason for doing it with forms is to persist the form data so
users can come back later and their data is still there, such as when a
form is split across multiple pages..

perhaps you could just ask him why he is doing it.

On Tue, Jan 31, 2012 at 8:24 PM, Maureen mamamaur...@gmail.com wrote:


 I think I ran across that guy once (lol).  IMO, loading anything other
 the absolute minimum required info to identify a unique session into
 session variables is bad coding practice.

 On Tue, Jan 31, 2012 at 8:01 AM, Robert Harrison
 rob...@austin-williams.com wrote:
 
  I'm an old school programmer who watches every bit and byte and really
 practices resource management in my coding practices.
 
  I've got a new programmer working for me (on contract) and I'm finding
 he's using session Vars all over the place. He creating session Vars on
 forms that have a hundred fields, he putting arrays into session Vars, etc.
 I just went through a few of the programs he wrote and used them, then I
 dumped my session vars and found I had over 250 session vars from just
 using a few programs. Considering the site has over 1,000 users on it at
 any given moment, I'm very concerned about this practice.
 
  Am I nuts, or is this just bad?
 
  Thanks,
  Robert

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349689
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Opinion: Abuse of session variables

2012-01-31 Thread Dave Watts

 I've got a new programmer working for me (on contract) and I'm finding he's 
 using session Vars all over the place. He
 creating session Vars on forms that have a hundred fields, he putting arrays 
 into session Vars, etc. I just went through
 a few of the programs he wrote and used them, then I dumped my session vars 
 and found I had over 250 session vars
 from just using a few programs. Considering the site has over 1,000 users on 
 it at any given moment, I'm very concerned
 about this practice.

 Am I nuts, or is this just bad?

There are several possibilities:

1. You are nuts, and this is just bad.
2. You are nuts, and this is not bad.
3. You are not nuts, and this is just bad.
4. You are not nuts, but this is not bad.

The problem is, we don't have enough information to answer your
question. We cannot accurately determine whether you're nuts, or
whether this is bad. There's nothing inherently inappropriate about
storing arrays in session scope, or submitted form fields, etc. It
depends (as Jochem pointed out) on what your application is intended
to do, and the potential use-case scenarios around your application.
While memory is limited, it's much more efficient to store things in
memory rather than refetch them from a database - database
interactivity is typically the most expensive portion of an
application. If you had unlimited memory at your disposal, it would
make perfect sense to just store everything in there until you
absolutely have to write it to a persistent data store. But you don't
have unlimited memory, so you have a balancing act. We all would need
far more information than you've provided to tell you whether you're
off-balance one way or the other.

I will say this, though - there's a reason we have 64-bit servers nowadays.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349691
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Opinion: Abuse of session variables

2012-01-31 Thread Dave Watts

  IMO, loading anything other the absolute minimum required info to identify a 
 unique session into
 session variables is bad coding practice.

What does that mean? The absolute minimum required info to identify a
unique session would be the session ID. Are you saying any other use
of session variables is bad practice? If so, I'll have to disagree
with that pretty strenuously.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349692
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Opinion: Abuse of session variables

2012-01-31 Thread Dave Watts

 I have come across some similar code also, moving variables scope into
 sessions and back again for no reason.

There's actually a reason why that might be, in some cases. Not a good
reason, but a reason nonetheless. It used to be the case (CF 5 and
earlier) that you had to worry about locking a lot more than you do
now. So, people would do something like this:

!-- top of page --
cflock scope=session ...
cfset variables.localsession = session
/cflock

... do a bunch of stuff with those variables ...

!-- bottom of page --
cflock scope=session ...
cfset session = variables.localsession
/cflock

Unfortunately, it didn't work very well in practice.

 perhaps you could just ask him why he is doing it.

I am not being sarcastic when I say this - this is a very good suggestion.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349693
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: Lost SESSION variables - sometimes

2012-01-03 Thread Stephens, Larry V

Thanks. I'll try that. 


 

-Original Message-
From: Russ Michaels [mailto:r...@michaels.me.uk] 
Sent: Friday, December 30, 2011 7:05 PM
To: cf-talk
Subject: Re: Lost SESSION variables - sometimes


it is probably a cookie issue as this is how the session is tracked.
clear the cookies and cache on that browser and see if it helps.
Also make sure cookies are not disabled.

On Fri, Dec 30, 2011 at 7:26 PM, Stephens, Larry V steph...@indiana.eduwrote:


 CF8

 My home page populates a session variable. I did a dump to make sure 
 this was happening.

 Mozilla (Firefox) - newest download

 On one machine I go to another page off my menu and it displays correctly.

 I go to another machine and I get an error - no session variable defined.
 The entire SESSION scope is lost on this machine.

 IE - works fine on both machines.



 I don't see how it can be a coding issue since it works in IE and in 
 Mozilla on other machines.

 Does anyone have a clue why certain iterations of Firefox would cause 
 the loss of the SESSION variable?

 Larry Stephens

 



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349296
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Lost SESSION variables - sometimes

2011-12-30 Thread Stephens, Larry V

CF8

My home page populates a session variable. I did a dump to make sure this was 
happening.

Mozilla (Firefox) - newest download

On one machine I go to another page off my menu and it displays correctly.

I go to another machine and I get an error - no session variable defined. The 
entire SESSION scope is lost on this machine.

IE - works fine on both machines.



I don't see how it can be a coding issue since it works in IE and in Mozilla on 
other machines.

Does anyone have a clue why certain iterations of Firefox would cause the loss 
of the SESSION variable?

Larry Stephens

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349264
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Lost SESSION variables - sometimes

2011-12-30 Thread Russ Michaels

it is probably a cookie issue as this is how the session is tracked.
clear the cookies and cache on that browser and see if it helps.
Also make sure cookies are not disabled.

On Fri, Dec 30, 2011 at 7:26 PM, Stephens, Larry V steph...@indiana.eduwrote:


 CF8

 My home page populates a session variable. I did a dump to make sure this
 was happening.

 Mozilla (Firefox) - newest download

 On one machine I go to another page off my menu and it displays correctly.

 I go to another machine and I get an error - no session variable defined.
 The entire SESSION scope is lost on this machine.

 IE - works fine on both machines.



 I don't see how it can be a coding issue since it works in IE and in
 Mozilla on other machines.

 Does anyone have a clue why certain iterations of Firefox would cause the
 loss of the SESSION variable?

 Larry Stephens

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349272
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Session Variables

2011-10-18 Thread Rick T

cfapplication name=newapp
 sessionmanagement=yes
 sessiontimeout=#CreateTimeSpan(14,0,0,0)#

My session expires in as little as 20 minutes, I dont understand why so early 
when I set the timeout for 14 days. 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:348201
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


  1   2   3   4   5   6   7   8   9   10   >