O'Reilly logo

Adobe ColdFusion 8 Web Application Construction Kit, Volume 1: Getting Started by Charlie Arehart, Raymond Camden, Ben Forta

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

Using <cflogin> and <cfloginuser>

The first thing you need to do is add the <cflogin> and <cfloginuser> tags to whatever parts of your application you want to protect. To keep things nice and clean, the examples in this chapter keep the <cflogin> and <cfloginuser> code in a separate ColdFusion template called ForceUserLogin.cfm (Listing 23.6).

Once a template like this is in place, you just need to include it via <cfinclude> from any ColdFusion page that you want to password-protect. To protect an entire application, just place the <cfinclude> into your Application.cfc template. Since it automatically executes for every page request, the <cflogin> and related tags will be automatically protecting all of your application’s pages.

Listing 23.6. ...

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