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

Checking and Maintaining Login Status

For instance, assume for the moment that the user has just filled out a user name/password form (more on that later), and you have verified that the user name and password are correct. You could then use a line such as the following to remember that the user is logged in:

<cfset SESSION.isLoggedIn = "Yes">

As you learned in the last chapter, the isLoggedIn variable is tracked for the rest of the user’s visit (until their session times out). From this point forward, if you wanted to ensure that the user was logged in before they were shown something, all you would need to do would be to check for the presence of the variable:

<cfif not isDefined("SESSION.isLoggedIn")> Sorry, you don't have permission to look ...

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