Using the Storage APIs

Before you begin, see Storage Functions.

Setting/getting an item

<cfclientsettings enableDeviceAPI=true>

<cfclient>
 
<cfset cfclient.localstorage.setItem("key1","value1")>
<cfset keyVal = cfclient.localstorage.getItem("key1")>

</cfclient>

Removing an item

<cfclientsettings enableDeviceAPI=true>

<cfclient>

<cfset cfclient.localstorage.setItem("key1","value1")>
<cfset keyVal = #cfclient.localstorage.getItem("key1")>

<cfset cfclient.localstorage.removeItem("key1")>

</cfclient>

Get help faster and easier

New user?