Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Sep 2002
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    COOKIES ? cant read them !

    ok me again... i cant read the cookies i have succefully set on the clients computer this is the code im using to load the cookies

    ==

    if ($ENV{'HTTP_COOKIE'}) {

    @cookie = split (/;/,
    $ENV{'HTTP_COOKIE'});
    foreach $cookie (@cookies) {
    ($name, $vale) = split (/=/,
    $cookies);
    $crumbs{$name} = $value;

    }
    }

    ==

    can anyone help me ?

  • #2
    New to the CF scene
    Join Date
    Aug 2002
    Location
    PA
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i dont know anything about cookies but maybe on the split by '=' you should change the $cookies to @cookies, this is more of a random guess. Spell $value the right way.

    -Mark
    -TECHNOPHOBIA-

  • #3
    New to the CF scene
    Join Date
    Sep 2002
    Location
    Syracuse, NY
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Just try this Routing.. I use this code all the time. It takes the entire cookie string and breaks it into name/value pairs and puts them in the CookieInfo variable. Easy to refrence by name.


    # Get Cookie...
    %CookieInfo = ();
    $buffer = $ENV{'HTTP_COOKIE'};
    @pairs = split(/&/, $buffer);
    foreach $pair (@pairs) {
    ($name, $value) = split(/=/, $pair);
    $name =~ tr/+/ /;
    $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
    $value =~ tr/+/ /;
    $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
    $CookieInfo{$name} = $value;
    }

    # this is the value of the cookie nameofcookie
    $mycookie=$CookieInfo{'nameofcookie'} ;

    GOOD LUCK!


  •  

    Posting Permissions

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