The various scopes available to a CFCoder have different visibilities and 
lifetimes. A request variable has a lifetime of the request that it was 
created in. When a user requests a page, and Application.cfm begins 
processing, no request variables exist, so IsDefined("request.x") in an 
application.cfm will also show that the variable does not exist if you 
haven't yet set it anywhere.

As soon as the page finishes processing any request variables are destroyed. 
So if you are setting them in your application.cfm just set them, and don't 
worry about the IsDefined check in this case.

Cheers



>From: "Bogesdorfer, Dan" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: CF-Talk <[EMAIL PROTECTED]>
>Subject: Will isdefined(request.varName) work in application.cfm?
>Date: Thu, 18 Jul 2002 08:55:51 -0400
>
>I'm trying to scope my application vars to request vars.  I can't see
>locking my application.userName, application.passWord in CFQUERY and if I
>need to do request.varName = application.varName why not just scope them to
>request vars in the application.cfm.  I know from my last post that some
>people are using request vars in place of application variables.  It seems
>as though if I set a request variable in your application.cfm it "WILL" be
>set on every page request and its not possible to use isdefined() against
>it?  Is this true?  Example:
>
><cfif not isdefined('request.username')>
>
>                       <cfset request.username = "demo">
>                       <cfset request..password = "demo">
></cfif>
>
>This seems to enter the IF LOOP on every page request.
>
>Thanks..
>
>Daniel Bogesdorfer
>Senior Programmer / Analyst
>Office Of Research Health Sciences
>University of Pittsburgh
>412.648.2366
>
>
>
______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to