How to Read & Display a PHP Cookie Value in AS3

The ActionScript language lets you read cookies from other PHP pages in your Web project and display the values in the user's browser. You use this information to log in the user automatically or store information between pages in your website. You must use the cookie's name to retrieve the data, because PHP can create multiple cookies.

Instructions

    • 1

      Open the ActionScript editor and open the Web project for your website. Double-click the coding file you want to use to read and display the cookie.

    • 2

      Read the data from the cookie. The following code reads a cookie named "mycookie" from the user's browser:

      cookie = SharedObject.getLocal("mycookie");

    • 3

      Display the cookie's information on the Web page. You display the content using one of your ActionScript text boxes. The following code writes the cookie data to a text box named "showstring":

      showstring.text = cookie;

Related Searches:

References

Comments

Related Ads

Featured