You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs-cvs@perl.apache.org by pg...@apache.org on 2005/07/17 02:01:54 UTC

svn commit: r219358 - /perl/modperl/docs/trunk/src/docs/2.0/user/coding/cooking.pod

Author: pgollucci
Date: Sat Jul 16 17:01:53 2005
New Revision: 219358

URL: http://svn.apache.org/viewcvs?rev=219358&view=rev
Log:
add a recipe for libapreq2

Modified:
    perl/modperl/docs/trunk/src/docs/2.0/user/coding/cooking.pod

Modified: perl/modperl/docs/trunk/src/docs/2.0/user/coding/cooking.pod
URL: http://svn.apache.org/viewcvs/perl/modperl/docs/trunk/src/docs/2.0/user/coding/cooking.pod?rev=219358&r1=219357&r2=219358&view=diff
==============================================================================
--- perl/modperl/docs/trunk/src/docs/2.0/user/coding/cooking.pod (original)
+++ perl/modperl/docs/trunk/src/docs/2.0/user/coding/cooking.pod Sat Jul 16 17:01:53 2005
@@ -65,6 +65,28 @@
 as a hack, but handlers should never manipulate the
 status field in the request record.
 
+=head1 Sending Cookies Using libapreq2
+
+  use Apache2::Request ();
+  use Apache2::RequestRec ();
+  use Apache2::Const -compile => qw(OK);
+  
+  use APR::Table ();
+  use APR::Request::Cookie ();
+  
+  sub handler {
+      my $r = shift;
+      my $req = $r->pool();
+      
+      my $cookie = APR::Request::Cookie->new($req, name => "foo", value => time(), path => '/cookie');
+      
+      $r->err_headers_out->add('Set-Cookie' => $cookie->as_string);
+      
+      $r->content_type("text/plain\n\n");
+      $r->print("Testing....");
+      
+      return Apache2::Const::OK;
+  }
 
 =head1 Maintainers
 



---------------------------------------------------------------------
To unsubscribe, e-mail: docs-cvs-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-cvs-help@perl.apache.org