MACROMEDIA COLDFUSION 5 - CFML Reference page 73

Cfml reference
Hide thumbs Also See for COLDFUSION 5 - CFML:
Table of Contents

Advertisement

Alphabetical List of ColdFusion Tags
Warning
Do not set a cookie variable on the same page that you use the
do, the cookie is never saved on the browser; therefore, it is of no value.
Example
<!--- This example shows how to set a cfcookie variable,
and also how to delete that variable --->
<!--- First select a group of users who have entered
comments into the sample database --->
<cfquery name = "GetAolUser" dataSource = "cfsnippets">
SELECT EMail, FromUser, Subject, Posted
FROM
</cfquery>
<html>
<head>
<title>
cfcookie Example
</title>
</head>
<body bgcolor = silver>
<H3>cfcookie Example</H3>
<!--- if the URL variable delcookie exists,
set the cookie's expiration date to NOW --->
<cfif IsDefined("url.delcookie") is True>
<cfelse>
<!--- Otherwise, loop through the list of visitors,
and stop when you match the string aol.com in the
visitor's e-mail address --->
<cfloop query = "GetAOLUser">
</cfloop>
<!--- If the timeVisited cookie is not set,
set a value --->
Comments
<cfcookie name = "TimeVisited"
value = "#Now()#"
expires = "NOW">
<cfif FindNoCase("aol.com", Email, 1) is not 0>
<cfcookie name = "LastAOLVisitor"
value = "#Email#"
expires = "NOW" >
</cfif>
<cfif IsDefined("Cookie.TimeVisited") is False>
<cfcookie name = "TimeVisited"
value = "#Now()#"
expires = "10">
</cfif>
55
tag. If you
cflocation

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION 5 - CFML and is the answer not in the manual?

This manual is also suitable for:

Coldfusion 5

Table of Contents