DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Cookies In Flex

11.09.2010
| 2821 views |
  • submit to reddit
        // access browser cookies from flash/flex

import flash.external.ExternalInterface;
import flash.net.URLVariables;

public var Cookies: URLVariables = new URLVariables(ExternalInterface.call("function(){return '8=); '+document.cookie}").replace(/;\s/g, "&"));

// usage

Cookies['test']="blah";
trace("cookie " + Cookies['test']);