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 Session Variables

After you have enabled session variables using sessionMangement, you can start using them in your code. ColdFusion provides a special SESSION variable scope, which works similarly to the CLIENT and COOKIE scopes you are already familiar with. You can set and use session variables simply by using the SESSION prefix in front of a variable’s name.

For instance, instead of the CLIENT.lastSearch used in the SearchForm.cfm examples above, you could call the variable SESSION.lastSearch. The examples would still work in essentially the same way. The only difference in behavior would be that the memory interval of each user’s last search would be short (until the end of the session), rather than long (90 days, by default).

For ...

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