<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -36,7 +36,7 @@ our @C = (
       my $v            = $self-&gt;v;
       $v-&gt;{name}       = $name;
       $v-&gt;{controller} = $self-&gt;name;
-      $v-&gt;{_secret_from_json} = 
+      $v-&gt;{_secret_from_json} =
         'The JSON view will purposely omit this data, '.
         'because the $V{json}-&gt;profile template was written to '.
         'ignore the key, _secret_from_json.';
@@ -46,30 +46,57 @@ our @C = (
     }
   ),
 
+  # This controller shows you how $self-&gt;cookies handles
+  # both incoming AND outgoing cookies.
+  # - incoming cookies are stored in the $self-&gt;cookies hashref as strings
+  # - outgoing cookies are stored in the $self-&gt;cookies hashref as hashrefs
+  #     that can be fed to CGI::Cookie
+  C(
+    Cookie =&gt; [ '/cookies' ],
+    get =&gt; sub {
+      my ($self) = @_;
+      $self-&gt;v-&gt;{cookies} = [
+        map {
+          {
+            name  =&gt; $_,
+            value =&gt; $self-&gt;cookies-&gt;{$_},
+          }
+        } sort keys %{$self-&gt;cookies}
+      ];
+      $self-&gt;render('cookies');
+    },
+    post =&gt; sub {
+      my ($self) = @_;
+      my $input  = $self-&gt;input;
+      my $name   = $input-&gt;{name};
+      my $value  = $input-&gt;{value};
+      $self-&gt;cookies-&gt;{$name} = { -value =&gt; $value };
+      $self-&gt;redirect(R('Cookie'));
+    },
+  ),
+
   C(
     Count =&gt; [ '/@count' ],
-    # GET requests to the Count controller have the following properties:
-    # - They are sent to a different session queue.
-    # - The session queue is named &quot;${session_id}.count&quot;.
-    # - The queue =&gt; { get =&gt; 'count' } is what made this happen.
-    # - Squatting::Mapper treats controllers with a queue attribute specially.
-    # - It will run GET requests in their own coroutine separate from the 
-    #   RESTful controllers.
-    # - This coroutine may handle many more HTTP requests.
+    # Requests to the Count controller run in a separate coroutine.
+    # - The (continuity =&gt; 1) tells Squatting::Mapper to take notice
+    #   of this controller and put requests to this controller in
+    #   a different &quot;session queue&quot;.  In Continuity-speak, being in
+    #   a different &quot;session queue&quot; means you get your own coroutine.
+    continuity =&gt; 1,
+
     get =&gt; sub {
       my ($self) = @_;
       my $cr     = $self-&gt;cr;
       my $i      = 1;
+      # Infinite loops are allowed in Continuity controllers.
       while (1) {
-        # - In fact, this one won't ever return control back to Squatting.
+        # - Typically, you won't ever return control back to Squatting.
         # - You're in Continuity land, now.
         $cr-&gt;print($i++);
+        # $cr-&gt;next blocks until the next request comes in.
         $cr-&gt;next;
       }
     },
-    post =&gt; sub {
-    },
-    queue =&gt; { get =&gt; 'count' }
   ),
 
   C(
@@ -85,13 +112,13 @@ our @C = (
     get =&gt; sub {
       my ($self) = @_;
       my $v = $self-&gt;v = $self-&gt;env;
-      my $format = ($v-&gt;{REQUEST_PATH} eq '/env') 
-        ? 'html' 
-        : 'json';  
+      my $format = ($v-&gt;{REQUEST_PATH} eq '/env')
+        ? 'html'
+        : 'json';
       $self-&gt;render('env', $format);
       # This will use the generic json template called '_'
       #   if ($format eq 'json').
-      # The generic template, '_', is used 
+      # The generic template, '_', is used
       #   when no other template can be found.
     }
   ),</diff>
      <filename>eg/Example/Controllers.pm</filename>
    </modified>
    <modified>
      <diff>@@ -26,6 +26,7 @@ our @V = (
             li(a({-href =&gt; '/~beppu.json'}, &quot;profile.json&quot;)),
             li(a({-href =&gt; '/env'},         &quot;env&quot;)),
             li(a({-href =&gt; '/env.json'},    &quot;env.json&quot;)),
+            li(a({-href =&gt; '/cookies'},     &quot;cookies&quot;)),
             li(a({-href =&gt; '/rubygems'},    &quot;redirect to ruby's gem_server on port 8808&quot;)),
             li(a({-href =&gt; '/pod/'},        &quot;PODServer has been mounted on /pod&quot;)),
             li(a({-href =&gt; '/droids-you-are-looking-for'}, &quot;404&quot;)),
@@ -55,6 +56,25 @@ our @V = (
       h2(&quot;env&quot;),
       pre(dump($v));
     },
+    cookies =&gt; sub {
+      my ($self, $v) = @_;
+      h2(&quot;Cookies&quot;),
+      dl(
+        map {
+          dt($_-&gt;{name}),
+          dd($_-&gt;{value})
+        } @{$v-&gt;{cookies}}
+      ),
+      start_form(-method =&gt; 'POST', -action =&gt; R('Cookie'), -enctype =&gt; &amp;CGI::URL_ENCODED),
+        dl(
+          dt('Cookie Name'),
+          dd(textfield(-name =&gt; 'name')),
+          dt('Cookie Value'),
+          dd(textfield(-name =&gt; 'value')),
+        ),
+        submit(),
+      end_form(),
+    },
   ),
 
   V(</diff>
      <filename>eg/Example/Views.pm</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>0c09ae82022614939810e28cfb5a5c07daf84af8</id>
    </parent>
  </parents>
  <author>
    <name>John Beppu</name>
    <email>john.beppu@gmail.com</email>
  </author>
  <url>http://github.com/beppu/squatting/commit/33d626c8f6e0120906035538f5bc4f58be4f3ed6</url>
  <id>33d626c8f6e0120906035538f5bc4f58be4f3ed6</id>
  <committed-date>2009-06-14T21:59:29-07:00</committed-date>
  <authored-date>2009-06-14T21:59:29-07:00</authored-date>
  <message>added a cookie example to the Example app</message>
  <tree>9907ef68c0cd315ef1b53359615a21ec43a3f31e</tree>
  <committer>
    <name>John Beppu</name>
    <email>john.beppu@gmail.com</email>
  </committer>
</commit>
