in reply to Re: Baking Cookies and Eating them
in thread Baking Cookies and Eating them

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re^3: Baking Cookies and Eating them
by grep (Monsignor) on Sep 30, 2006 at 21:55 UTC
    What doesn't work?
    What do you get?
    What was the code you used (preferably just the section in question)?
    Have you read How (Not) To Ask A Question?

    Try dumping the value returned and see what you get.

    use Data::Dumper; my %cookie_value = $cookies{'LSRfm'.$type}->value; print qq|<pre>|; print Dumper \%cookie_value; print qq|</pre>|;


    grep
    Mynd you, mønk bites Kan be pretti nasti...

      Data Dump

      $VAR1 = { '{ username => barrycarlyon, password => 025a38ae929ace0637824f7728da371d }' => undef };

      code:
      sub _cookie { #read in the lsrfm cookie to test my $self = shift; # my $cgi = CGI->new; # my $type = $cgi->param('type'); my $type = shift; #lets check to see if the lsrfm cookie exits #fecth the domains cookie my %cookies = fetch CGI::Cookie; my $cookies; my $lsrfm_cookie; if (!%cookies) { #a domain cookie doesnt exist #leave as blank } else { #a domain cookie exists #fetch the type value my $n = 0; my $this_cookie; my @cookies = (keys %cookies); foreach (keys %cookies) { $this_cookie = $cookies[$n]; if ($this_cookie eq ('LSRfm'.$type)) { $lsrfm_cookie = $cookies{'LSRfm'.$type}->value; } $n ++; } } use Data::Dumper; my %cookie_value = $cookies{'LSRfm'.$type}->value; print qq|<pre>|; print Dumper \%cookie_value; print qq|</pre>|; exit; return $lsrfm_cookie; }
      Barry Carlyon barry@barrycarlyon.co.uk

        right off the bat i'd like to say i'd NEVER put a parameter in a cookie called "password". if that gets intercepted, you've made it all to easy (encrypted or not) for someone to get ahold of a users password.

        meh.
        Thanks.

        So $cookies{'LSRfm'.$type}->value returned a hash ref. Which I guess, means I didn't read the docs right.

        What do you get with

        use Data::Dumper; my $cookie_value = $cookies{'LSRfm'.$type}->value; print qq|<pre>|; print Dumper $cookie_value; print qq|</pre>|; exit;


        grep
        Mynd you, mønk bites Kan be pretti nasti...