Fellow monks, I making a first attempt at setting and reading cookies. I seem to be able to set a cookie successfully:
my $r = Apache->request;
Apache::Cookie->new( $r,
name => 'license_session',
value => $secret,
path => '/',
expires => '+8h',
)->bake;
My real problem is in reading cookies:
my $cookie = Apache::Cookie->fetch;
my $name = $cookie->name;
my $value = $cookie->value;
print "<h3>name = $name</h3>\n";
print "<h3>value = $value</h3>\n";
An error is returned: Can't call method "name" on an undefined value. This error points to the line where $name is defined. The documentation for apache::cookie is pretty small. Having read it, I thought this would be simple. What have I missed?