Another Flex Sample: Using Local SharedObjects
Here is a Flex mini-application that illustrates the use of a local SharedObject to maintain application state on the client. This app also illustrates what I consider to be good division between MXML code and ActionScript code, leveraging the power of MXML for setup, configuration and event wiring, while encapsulating the sticky bits in ActionScript components. Source code is included.
http://ech.net/flexsamples/so.swf
(This Flex samples directory is starting to cry out for an index page.)
The local SharedObject feature of the Flash player is becoming more widely used. Pandora is one example of a site that uses it to persist application state. It accomplishes what cookies were originally intended to do, but does not involve the web server, and thus avoids many of the security concerns of cookies. But there are valid criticisms of this feature. The browsers do not ask the user for permission to write this potentially personal data to the disk, nor do they offer the user a straightforward way to purge this data from the system. Dig around in your personal documents area for a directory called #SharedObjects, then look inside to see what sites have written information to your disk. For more information, see the Wikipedia page on the subject.
Although insidious, this feature sure is handy for the Flex developer.