in reply to Setting several values and Reading them from a cookie
Create cookies from scratch with the new method. The -name and -value parameters are required. The name must be a scalar value. The value can be a scalar, an array reference, or a hash reference. (At some point in the future cookies will support one of the Perl object serialization protocols for full generality).So you can set multiple values by doing
If there are multiple values for a cookie, the $cookie->value method will return a list of them (only if it's called in list context, of course).my $cookie = new CGI::Cookie( -name => 'ChocolateChip', -value => [ 'Sweet', 'Semi-Sweet', 'Yumm +y' ] );
blokhead
|
|---|