Deletes the client variable specified by name. Returns a Boolean TRUE when variable is successfully deleted, even if variable did not previously exist. To test for the existence of a variable, use IsDefined.
DeleteClientVariable("name")
| Parameter |
Description |
|---|---|
| name |
Name of a client variable to delete, surrounded by double quotes |
If the client variable specified by name does not exist, an error is returned.
<!--- 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>