SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot Tiger_Tom's Avatar
    Join Date
    Feb 2000
    Location
    U.K.
    Posts
    194
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cookie annoyance

    I've been trying to get a script to print out all the cookies for my domain.


    $HTTP_COOKIE_VARS on its own gives something like: (Array)

    $cookie_list = getenv("HTTP_COOKIE_VARS") gives nothing

    Any ideas what I might be doing wrong?

    Another Perl script I have reads the cookies in my browser OK.

  2. #2
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try print_r($_COOKIE);

  3. #3
    SitePoint Zealot Tiger_Tom's Avatar
    Join Date
    Feb 2000
    Location
    U.K.
    Posts
    194
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That doesn't seem to work. I want the variable to be sent in an email message. $_COOKIE doesn't seem have any value either. Strange.

  4. #4
    SitePoint Zealot Tiger_Tom's Avatar
    Join Date
    Feb 2000
    Location
    U.K.
    Posts
    194
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Follow-up: In the end, I had to output the cookie I wanted by name. THAT, at least, worked

  5. #5
    SitePoint Evangelist dmsuperman's Avatar
    Join Date
    Feb 2005
    Location
    A box
    Posts
    516
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    $_COOKIE is an array. That's why just echoing it gives Array. print_r() outputs all elements of an array.

  6. #6
    SitePoint Zealot Tiger_Tom's Avatar
    Join Date
    Feb 2000
    Location
    U.K.
    Posts
    194
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So how do I assign it to a scalar, so I can send it in an email?


Bookmarks

Posting Permissions

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