deleteClientVariable

Description

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

Categories

Related

History

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

Syntax

DeleteClientVariable("name")

Attributes

AttributeDescriptionRequiredDefault
nameName of a client variable to delete, surrounded by double-quotation marks

Returns

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

Example

<!--- This view-only example shows DeleteClientVariable ---> 
<h3>DeleteClientVariable Example</h3> 
 
This view-only example deletes a client variable called "User_ID", if it  
    exists in the list of client variables returned by GetClientVariablesList. 
This example requires the existence of an Application.cfm file and client 
    management to be in effect. 
<!---  
<cfset client.somevar = ""> 
<cfset client.user_id = ""> 
Client variable list:<cfoutput>#GetClientVariablesList()#</cfoutput> 
<cfif ListFindNoCase(GetClientVariablesList(), "User_ID") is not 0> 
 
        <cfset temp = DeleteClientVariable("User_ID")> 
        Was variable "User_ID" Deleted? <cfoutput>#temp#</cfoutput> 
</cfif> 
Amended Client variable list:<cfoutput>#GetClientVariablesList()# 
</cfoutput> 
--->