> -----Original Message-----
> From: Rick Mason [mailto:[EMAIL PROTECTED]
> Sent: Saturday, March 12, 2005 1:10 PM
> To: CF-Talk
> Subject: Re: Application.cfc - why? what's it for?
> 
> Jim,
> 
> So lets say I have code at the top of every page in my application
> that checks for the existence of certain session variables and if it
> doesn't find them redirects the user to a login page.
> 
> You're saying that I could define this once in application.cfc and set
> the behavior for the entire application?  Tthis could be a huge
> timesaver for me in building portals.

Exactly - you would probably do this in the "request start" method (so that
at the beginning of every request this is checked).

Of course in this particular case you could also do this in Application.cfm
(which has been around since v3) - there's really never a reason to put
something like that in every file of a site.

Application.cfm runs as an "auto include" on every request (and
OnRequestEnd.cfm runs as an auto include at the end of every request).  

Application.cfc runs as "auto method calls" but for several more events:
request start/end, session start/end, application start/end, errors, etc.

Jim Davis





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:198547
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to