Revision 3 (by ahitrov@rambler.ru, 2010/03/24 15:19:32) The CORE
<%args>
	$name
	$value => undef
	$expires => undef
</%args>
<%init>
	if (defined $value)
	{
		my $cookie = new CGI::Cookie (
		##	-domain => '.rambler.ru',
			-name 	=> $name,
			-value 	=> $value,
			defined $expires ? (-expires => $expires) : (),
			-secure => 0,
		);
		$r->headers_out->add('Set-cookie' => $cookie);
	}
	else
	{
		my %cookies = fetch CGI::Cookie;
		my $value = $cookies{$name}->value() if exists $cookies{$name} && $cookies{$name};
		return $value;
	}
</%init>