in reply to Re: Re: CGI::cookie query
in thread CGI::cookie query

Use $query->header( -cookie=> \@cookies ); (note the '\', that makes the call use a reference to @cookies as opposed to the variable @cookies itself), instead of what I had initially. Again, it's untested, so it might not work, though I doubt that it won't work this way.
Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain

Replies are listed 'Best First'.
Re: Re: Re: Re: CGI::cookie query
by costas (Scribe) on Apr 02, 2001 at 21:25 UTC
    Strange, it still only prints out the last instance. Can you think of anything else, Im pulling my hair out on this end!! THanks
Re: Re: Re: Re: CGI::cookie query
by costas (Scribe) on Apr 02, 2001 at 21:28 UTC
    Just to show you the code. $inputs is a hash
    sub set_cookie_value { my ($inputs) = @_; $query = new CGI(); my $cookie = ""; my @cookies = (); my $key; foreach $key (keys %$inputs) { $cookie = new CGI::Cookie(-name=>$key, -value=>$inputs->{$key} +, -expires=>$inputs->{$key}, -path=>'/', -domain=>'', -secure=>0); push (@cookies, $cookie); } print $query->header( -cookie=> \@cookies ); }