perl-docs-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pgollu...@apache.org
Subject svn commit: r219358 - /perl/modperl/docs/trunk/src/docs/2.0/user/coding/cooking.pod
Date Sun, 17 Jul 2005 00:01:54 GMT
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


Mime
View raw message