chuleto1 has asked for the wisdom of the Perl Monks concerning the following question:
It is late, I am tired of searching for this on the web! Please help a weary monk.
I would like to know how to set several values in the -value=> part of the cookie (this values come from a form). I would also like to know how to read those values once the cookie is set and have the ChocolateChip cookie to read from (look at the code).#!/usr/bin/perl use strict; use CGI; my $cgi = new CGI; print $cgi->header( -cookie => new CGI::Cookie( -name => 'ChocolateChip', -value=> $cgi->param('name'), -expires => 'Thu, 26-Sep-2002 00:00:00 GMT', -domain => 'students.cs.byu.edu', -path => '/' + ) )
-thanks#!/usr/bin/perl use strict; use CGI; my $cgi = new CGI; my %cookie = $cgi->cookie(-name => "ChocolateChip"); if(defined %cookie) { # read from the cookie ChocolateChip to have my document display user # preferences that were saved int the -value=> part of the cookie }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Setting several values and Reading them from a cookie
by blokhead (Monsignor) on Sep 22, 2002 at 04:48 UTC | |
•Re: Setting several values and Reading them from a cookie
by merlyn (Sage) on Sep 22, 2002 at 15:13 UTC | |
Re: Setting several values and Reading them from a cookie
by BrowserUk (Patriarch) on Sep 22, 2002 at 04:43 UTC |
Back to
Seekers of Perl Wisdom