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.