Gossamer Forum
Quote Reply
Retrieving Cookies
Sorry if this has been posted before, I haven't been able to find the answer so far.

Is there a way to directly use a template tag to retriever a cookie? I have been able to pull this off using globals, but wonder if there is a better way.

I did it by setting a new global variable equal to:
Code:
sub {
use GT::CGI;
my $cgi = new GT::CGI;
$cgi->cookie('cookie_name')
}

Call that global variable in a template and it prints the value of the cookie by that name.

Any ideas?
Michael Coyne
seaturtle.org
Quote Reply
Re: [mcoyne] Retrieving Cookies In reply to
You don't need to use GT::CGI as the cgi object is already available....eg...

sub {
return $IN->cookie('cookie_name');
}