Rick Faircloth wrote:
> I'm trying to set session variables for login with the code below.
> It works fine on my local dev pc, but on the production server,
> no session variables are being set.  Is the code below not appropriate?
>
> Thanks,
>
> Rick

ColdFusion does not care, but lots of OOP types will probably point out 
that it is considered bad practice to reference external scopes inside 
of a component.  Just for this type of difficulty.

ColdFusion's only problem with this is the for sessions to work properly 
all code referencing the same session must be in the same 'application' 
as determined with an <cfapplication...> tags with the same 'name' 
property.  How this affects components is that they are often placed in 
directories outside the normal web directories and thus are not under 
the usual Application.cfm|.cfc file that defines that application name.  
This is easy to fix by making sure that somehow or the other the 
component runs an <cfapplication....> tag with the desired application 
name.  But this can become very complex very quickly if the coponent is 
meant to be used by different applications running on the system.

Thus we are back to the OOP best practice of not referencing external 
scopes to the the component.  The better idea would be to return a 
structure of the data you are planning on putting into the session 
scope.  Then the calling code, that presumably is part of the 
appropriate 'application' will receive this structure and can simply 
copy it into the session scope.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:317516
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to