title: How do you use Plack::Middleware::Session with a Twiggy server?
body: <p>I have a <a href="https://metacpan.org/pod/Twiggy" rel="nofollow noreferrer"><code>Twiggy</code></a> based perl server:</p>
  <pre><code>my $app = sub { my $req = Plack::Request-&gt;new(shift); ... };
  my $twiggy = Twiggy::Server-&gt;new(port =&gt; $port);
  $twiggy-&gt;register_service($app);
  </code></pre>
  <p>It works fine, but now I want to add session management to it (to handle user authentication). I see there is a <a href="https://metacpan.org/pod/Plack::Middleware::Session" rel="nofollow noreferrer"><code>Plack::Middleware::Session</code></a> module on CPAN, but based on the docs for it and Twiggy I don't know how to use the two together. I've reason to believe it might be possible because in my $app I'm dealing with Plack stuff.</p>
  <p>Alternatively to using <code>Plack::Middleware::Session</code>, is there some other way I can easily get and set cookie values and maintain session state for authentication purposes? (Each page load requested by the user is handled in a new fork of the server.)</p>