Jim,

Thanks that is definitely something to try on my next project. 
Actually that check session code today is in a header file that's
cfincluded into every page by default.  So it's only ever in one place
anyway, but I get the idea.

I've also thought of the idea of having code that runs at the end of
every page by default.  You could build a table of who is logged in. 
Course you would have to remove people that haven't selected a page in
say twenty minutes or so.


Rick Mason




On Sat, 12 Mar 2005 13:29:00 -0500, Jim Davis
<[EMAIL PROTECTED]> wrote:
> > -----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:198559
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=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to