[cgiapp] Reading a Cookie

Flavio Poletti flavio at polettix.it
Thu Jul 24 17:24:54 EDT 2008


> So how do I read the cookie back using CGI:Application?  All the
> tutorials seem to assume the cookie is just there.  Maybe I'm
> overlooking something.

This is not actually related to CGI::Application, but to CGI.pm, whose
documentation is at http://search.cpan.org/dist/CGI.pm/

The short story is that you first get a reference to the CGI object like
this:

   my $cgi = $self->query(); # see "query" method in CGI::Application

then retrieve the cookie like this:

   my $cookie = $cgi->cookie('cookie_name');

See CGI.pm documentation for more directions and hints.

Cheers,

   Flavio.



More information about the cgiapp mailing list