O'Reilly logo

ColdFusion 9 Developer Tutorial by John Farrar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Custom authentication (additional power)

In this section, we will look at a customized way to handle authentication that gives us all the core features we need along with some additional enhancements. We are going to create a CFC for the user and nest the logic inside the user object for authentication. We will instantiate the user class as a session-based object. We will also take this logic and wrap it into Application.cfc so that it becomes portable and easier to implement in our programs. In the end, we will have more function and flexibility than the native authentication permission-handling system. Following is the code for the session start of Application.cfc:

<cffunction name="onSessionStart" output="false"> <cfscript> // create default ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required