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: A&W 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

Reply via email to