Using getAuthUser() in Your Application Pages

Once you save Listing 23.7 as a file named Application.cfc, users will be forced to log in whenever they visit any of the pages in that folder (or its subfolders). However, the order history pages that were created above will no longer work, since they rely on the SESSION.auth variables populated by the homegrown login framework. A few changes must be made to allow the order history pages with the <cflogin> framework. Basically, this just means referring to the value returned by getAuthUser() to get the user’s ID and first name, rather than using SESSION.auth.contactID and SESSION.auth.firstName. Listing 23.8 shows the new version of the order history template.

Listing 23.8. OrderHistory3.cfm—Using ...

Get Adobe ColdFusion 8 Web Application Construction Kit, Volume 1: Getting Started now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.