Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <cffunction name="saveState" access="remote" returntype="any" returnFormat="json">
- <cfargument name="name" required="yes">
- <cfargument name="val" required="yes">
- <cfargument name="cfctoken" required="yes">
- <cfset var result = structNew()>
- <cfif jsonSecurity(arguments.cfctoken)>
- <!--- if a js array or object was passed, then convert it to CF array or struct --->
- <cfif isJSON(arguments.val)>
- <cfset arguments.val = deserializeJSON(arguments.val)>
- </cfif>
- <cflock timeout="5" throwontimeout="No" type="EXCLUSIVE" scope="SESSION">
- <cfset session.festBuilder[arguments.name] = arguments.val>
- </cflock>
- <cfset result["success"] = true>
- <cfelse>
- <cfset result["success"] = false>
- </cfif>
- <cfreturn result>
- </cffunction>
Advertisement
Add Comment
Please, Sign In to add comment