Barry Found this on CFDEV and i thought i'd share for all you cretins out
there that don't know this concept or ... ya know my meaning..


-----QUOTE-----
There are two components:

1) Authenticator
2) User

I cache an instance of Authenticator in the application scope to avoid the
overhead of instantiating it every time a user need to authenticate.  Think
of Authenticator as an "engine" that performs authentication.  I can ask it
"is the following username and password valid?" by calling the
authenticate() method.

In my sample application, application.authenticator.authenticate() returns a
struct.  One of the keys of the struct is called isValid -- a boolean value
for whether the authentication was successful.  Another key of the struct
returned from authenticate is "user" -- it contains an instance of my user
component.

So, if the authetication is valid, I store the instance of the user
component in the session scope (the user component has private instance
variables that store the information about the user).

As a developer using these components, you never see queries or really deal
with the session scope (other than to call something like
session.user.isAdmin().

Thus, my Authenticator has only "static" functionality -- anyone can call
it.  My User holds instance data, and everyone gets their own instance
stored in their session.

Make sense?

 - Nathan

----QUOTE---


--
Freelance Application Developer / Designer
--
ph: 07 3288 6702
mob: 04040 32812
--
url: http://www.spidaweb.com




---
You are currently subscribed to cfaussie as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/

Reply via email to