Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2004
    Location
    Bay Area -USA
    Posts
    1,740

    get a cookie without knowing the cookie name?

    Is there a way to obtain all the cookie names that a user currently has and display them?

    For example say you have set 3 cookies for this user:

    cookie1
    cookie2
    cookie3

    I want the script to be able to say you have the following for our site:

    cookie1
    cookie2
    cookie3

    Also, is there a way to do this in flash?
    <<< Please see Forum Guidelines for signature setup. >>>

  2. #2
    Join Date
    Sep 2004
    Location
    Rohnert Park, CA
    Posts
    98
    In PHP you can just do...

    Code:
    foreach ( $_COOKIE as $key => $value ) {
    //.....
    }
    In PHP. I don't know that ActionScript has access to cookies, although you might consider putting the cookies in the calling of the Flash... instead of access myflash.swf, access myflash.swf?cookie1=data1&cookie2=data2 etc by creating a URL encoded string with PHP (or Perl or ASP.NET or whatever), that way you could probably just access all those variables by looping through the variables in the _root object, although I'm not sure how the specific could would look for that.
    Joshua Simmons
    Virtual Developer
    www.v-dev.com/

  3. #3
    Join Date
    Jul 2003
    Location
    Kuwait
    Posts
    5,104
    Just so its obvious, you can only display cookies that you have set (that are from your domain), not all cookies that the user has stored.

    For Flash, I don't think you can do this natively, but you can pass the cookie information from a PHP or javascript snippet to flash and display it there.

  4. #4
    Quote Originally Posted by fyrestrtr
    Just so its obvious, you can only display cookies that you have set (that are from your domain), not all cookies that the user has stored.

    For Flash, I don't think you can do this natively, but you can pass the cookie information from a PHP or javascript snippet to flash and display it there.
    also i have this quesion!
    i want a clode like "escape(document.cookie)" but in actionscript not javascript
    also i don't want use of this geturl("javascript:alert(document.cookie)")

Posting Permissions

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