A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Retrieving data from a cookie

  1. #1
    Senior Member
    Join Date
    Feb 2007
    Posts
    153

    Retrieving data from a cookie

    Hello.

    I have a problem with using a cookie in Flash and I need some help. I don't know too much about cookies so I am looking forward to your help.

    What I need is to retrieve the username from a cookie into Flash. I am using LoadVars to communicate with a PHP file that will echo the username.

    The problem is with the PHP file that should output the username from the cookie.

    Here is the simple PHP code that I have tried:
    PHP Code:
    $user $_SESSION['username'];
    echo 
    "user=".$user
    I have also tried the following:
    PHP Code:
    $user $_COOKIE['username'];
    echo 
    "user=".$user
    Are any of these correct ? Is there anything else that I need to do ? I am sure that it is something rather simple in the end.


    Again, what the PHP code needs to do is retrieve the username with the id of "username" from a cookie.


    Thank you.

  2. #2
    Senior Member
    Join Date
    Feb 2007
    Posts
    153
    Any ideas ?

  3. #3
    AS3 Mod
    Join Date
    Sep 2007
    Location
    O-H-I-O
    Posts
    2,385
    Well if it's a cookie then you can use:

    PHP Code:
    $user $_COOKIE['username'];
    echo 
    "&user=".$user
    If it's a session, then use a session. Cookies and sessions are two completely different things.

    Whats the flash code you are using?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center