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

Ive tried your script aswell. This is what im doing but it just wont put them all in the cookie. $inputs is a hash which contains only 9 instances (not over 4k).
sub set_cookie_value { my ($inputs) = @_; 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 header( -cookie=>\@cookies ); print "--$inputs->{'postcode'}--" }
Any further ideas?

Replies are listed 'Best First'.
Re: Re: Re: CGI::cookie query
by wardk (Deacon) on Apr 04, 2001 at 01:06 UTC

    what is the programs output?

    you can determine this by running it from a command line, CGI.pm will prompt you for some input variables (you can also pass them on the command line), like so: (line 1 is executing the script, 2 is the script prompting me for input, 3 is my input. between lines 3 and 4 I hit Ctrl-D, lines 4-7 is the output. in this case 2 cookies.

    1 xdev$ perl cook.pl 2 (offline mode: enter name=value pairs on standard input) 3 foo=bar 4 Set-Cookie: ID=123456 5 Set-Cookie: preferences=size&12&font&Helvetica 6 Date: Tue, 03 Apr 2001 21:01:04 GMT 7 Content-Type: text/html xdev$

    note the code executed above is the same code posted in the previous node