CGI::Thin::Cookies - A very lightweight way to read and set Cookies
my %cookie = &Parse_Cookies ();
print &Set_Cookie (VALUE = 'a cookie value',
EXPIRE => '+12h);>
This module is a very lightweight parser and setter of cookies. And it has a special feature that it will return an array if the same key is used twice for different cookies with the ame name. And you can force an array to avoid complications.
* 'CGI::Thin::Cookies::Parse_Cookies(@keys)' The optional @keys will be used to force arrays to be returned. The function returns a hash of the cookies available to the script. It can return more than one cookie if they exist. * 'CGI::Thin::Cookies::Set_Cookie (%options)VALUE => 'a cookie value', EXPIRE => '+12h);' The %options contain the the following information for the cookie: NAME: the name of the cookie VALUE: a string with the value of the cookie DOMAIN: the domain for the cookie, default is the '.secondaryDomain.toplevelDomain' PATH: the path within the domain, default is '/' SECURE: true or false value for setting the SECURE flag EXPIRE: when to expire including the following options "delete" -- expire long ago (the first second of the epoch) "now" -- expire immediately "never" -- expire in 2038 (the last second of the epoch in 31 bits) "+180s" -- in 180 seconds "+2m" -- in 2 minutes "+12h" -- in 12 hours "+1d" -- in 1 day "+3M" -- in 3 months "+2y" -- in 2 years "-3m" -- 3 minutes ago(!) If $time is false (0 or '') then don't send an expiration, it will expire with the browser being closed If you don't supply one of these forms, we assume you are specifying the date yourself
Visit CGI::Thin::Cookies' web site at http://www.PlatypiVentures.com/perl/modules/cgi_thin.shtml Send email to mailto:cgi_thin@PlatypiVentures.com
R. Geoffrey Avery CPAN ID: RGEOFFREY modules@PlatypiVentures.com http://www.PlatypiVentures.com/perl
This module is free software, you may redistribute it or modify in under the same terms as Perl itself.