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 ...

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.