> -----Original Message----- > From: John Pitchko [mailto:[EMAIL PROTECTED]] > Sent: Monday, July 29, 2002 12:15 PM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: RE: fetch CGI::Cookie Trouble > > > The code is: > > my $cookie1 = $query->cookie(-name => 'userid', -value => > "$username", -expires => '+1D', -secure => 1, -path => '/'); > my $cookie2 = $query->cookie(-name => 'verify', -value => > 'TRUE', -expires => '+1D', -secure => 1, -path => '/'); > print $query->header(-type => "text/html", -cookie => > [$cookie1, $cookie2]), > $query->start_html(-title => "User Verification Successful"), > $query->h1("Authorization Successful, User $username"), > $query->a({-href=>'/cgi-bin/template.cgi'}, 'Go to main page!!'), > > my %cookies = $query->cookie(-name => 'userid'); > my %cookies2 = $query->cookie(-name => 'verify');
You would only assign to a hash if you passed a hashref as the -value argument when you created the cookie, which you didn't. So just assign to a scalar: my $name = $query->cookie(-name => 'userid'); Also, you should retrieve cookies from the request before writing cookies to the response with $query->header. I'm not sure what the value of the cookie is if you call header first, but this seems out of order to me. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]