Storing Data with Profiles
The Flake System Object provides profiles with objects for storing data. Profiles can be treated similar to a hash table, and can store any data identified by a key. The following code shows an example of this.
fso.Profiles['key']=value;
This code demonstrates the general way of staring data into instance profiles. If a value is set against a key, permanent storing requires calling a save() method of the instance as shown below.
fso.save();
Once this has been called, the data can be safely retrieved for later use from this array by the following key.
var mydata = fso.Profiles['key'];
Note:
- Storing large data chunks in a profile slows down the flake's performance. The maximum size allowed is 8KB per item. For example, if your flake retrieves data using the ContentProxy, instead of directly storing all the results, it is better to parse the results and store only a smaller subset. In fact, unless you have a good reason to cache the data (e.g. it may be unavailable in the future), it is best to just retrieve the data through the ContentProxy whenever you need it.
- Calling
fso.save()in theload()function of the Flake User Object slows down the page load time significantly. - Only string values can be stored. To store an array, join the array into a delimited string, as described in Storing an Array into a Profile.
- Confidential information such as usernames and passwords should not be stored in a Profile in plain text.

