View comments | RSS feed

cfheader

Description

Generates custom HTTP response headers to return to the client.

Category

Data output tags, Page processing tags

Syntax

<cfheader 
  name = "header_name"
  value = "header_value">
or
<cfheader 
  statusCode = "status_code"
  statusText = "status_text">

See also

cfcache, cfflush, cfhtmlhead, cfinclude, cfsetting, cfsilent

Attributes

Attribute Req/Opt Default Description
name
Required if statusCode not specified

Header name
value
Optional

HTTP header value
statusCode
Required if name not specified

Number. HTTP status code
statusText
Optional

Explains status code

Usage

If you use this tag after the cfflush tag on a page, an error is thrown.

Example

<h3>cfheader Example</h3>

<p>cfheader generates custom HTTP response headers to return to the client. 
<p>This example forces browser client to purge its cache of requested file. 
<cfheader name = "Expires" value = "#Now()#">

ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6

Comments are no longer accepted for ColdFusion MX. ColdFusion 8 is the current version.

Comments


MatthewCParks said on Jun 19, 2003 at 3:13 PM :
I have used the CFHEADER tag instead of the CFLOCATION tag related to writing Cookies. (The whole CFCOOKIE and CFLOATION issues suggests to use CFHEADER) So I have been, BUT I have ran into a recent issue with users running Windows 98 and IE 6.0. The CFHEADER tag is to do a Redirect to desired page after cookie is written to client. I replaced CFHEADER for the redirect with the Meta tag directly. Then problem with users went away. Just wanted to share the learning. (PS Running CF 4.5 on Windows NT 4 server)

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/6/CFML_Reference/Tags-pt152.htm