User Guide
cfcookie 91
cfcookie
Description
Defines web browser cookie variables, including expiration and security options.
Category
Forms tags, Variable manipulation tags
Syntax
<cfcookie
name = "cookie_name"
value = "text"
expires = "period"
secure = "Yes" or "No"
path = "url"
domain = ".domain">
See also
cfdump, cfparam, cfregistry, cfsavecontent, cfschedule, cfset
History
ColdFusion MX 6.1:
• Changed the expires attribute: it now accepts a date time object.
• Cookie names can include all ASCII characters except commas, semicolons, or whitespace
characters.
Attributes
Attribute Req/Opt Default Description
name Required Name of cookie variable. ColdFusion converts cookie names to
all-uppercase. Cookie names set using this tag can include any
printable ASCII characters except commas, semicolons or white
space characters.
value Optional Value to assign to cookie variable. Must be a string or variable that
can be stored as a string.
expires Optional Expiration of cookie variable.
• The default: the cookie expires when the user closes the
browser, that is, the cookie is "session only".
• A date or date/time object (for example, 10/09/97)
• A number of days (for example, 10, or 100)
• now: deletes cookie from client cookie.txt file (but does not
delete the corresponding variable the Cookie scope of the
active page).
• never: The cookie expires in 30 years from the time it was
created (effectively never in web years).
secure Optional If browser does not support Secure Sockets Layer (SSL)
security, the cookie is not sent. To use the cookie, the page must
be accessed using the https protocol.
• Yes: variable must be transmitted securely
• No