Whatever message this page gives is out now! Go check it out!

DeleteClientVariable

Last update:
May 18, 2026

Description

Deletes a client variable. (To test for the existence of a variable, use IsDefined.)

Returns

True, if the variable is successfully deleted; false, otherwise.

Category

Function syntax

DeleteClientVariable(name)

See also

History

ColdFusion MX: Changed behavior: if the variable is not present, this function now returns False. (In earlier releases, it threw an error.)

Parameters

Parameter
Description
name
Name of a client variable to delete, surrounded by double-quotation marks

Example

<!--- This view-only example shows DeleteClientVariable --->
<HTML>
<HEAD>
<TITLE>DeleteClientVariable Example</TITLE>
</HEAD>

<BODY>
<!--- this example is view only --->
<H3>DeleteClientVariable Example</H3>

<P>This view-only example deletes a client variable called
"User_ID", if it exists in the list of client variables
returned by GetClientVariablesList().
<P>This example requires the existance of an Application.cfm file
and that client management be in effect.
<!--- 
<CFSET client.somevar="">
<CFSET client.user_id="">
<P>Client variable list:<CFOUTPUT>#GetClientVariablesList()#</CFOUTPUT>
<CFIF ListFindNoCase(GetClientVariablesList(), "User_ID") is not 0>
<!--- delete that variable --->
    <CFSET temp = DeleteClientVariable("User_ID")>
    <P>Was variable "User_ID" Deleted? <CFOUTPUT>#temp#</CFOUTPUT>
</CFIF>

<P>Amended Client variable list:<CFOUTPUT>#GetClientVariablesList()#
  </CFOUTPUT>

</BODY>
</HTML>

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page