Gaining More Control with <cfcookie>

You already have learned how to set cookies using the <cfset> tag and the special COOKIE scope (Listings 20.1 to 20.3). Using that technique, setting cookies is as simple as setting normal variables. However, sometimes you will want more control over how cookies get set.

Introducing the <cfcookie> Tag

To provide you with that additional control, ColdFusion provides the <cfcookie> tag, which is an alternative syntax for setting cookie variables. Once set, you can access or display the cookies as you have learned so far, by referring to them in the special COOKIE scope.

Table 20.2 introduces the attributes available when using <cfcookie>.

Table 20.2. <cfcookie> Tag Syntax
AttributePurpose
NAMERequired. The name ...

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.