gengo/decanter — pull request #64 by hayate (2013-08-01 10:32:28+00:00)
Title: fix session writing

After a wsgi wrapper returns the response is already been written and nothing else can be set. So that is why cookies or any other header cannot be set at that stage.
The solution is to write the cookie before the wsgi returns which means i had to reintroduce the SessionPlugin so that after the controller action is executed we can write the session.

So the session is initialize as soon as we get a request (in the middleware) and is written after each controller action is executed (in the plugin).