symfony/symfony — pull request #2727 by mlehner (2011-11-26 16:55:50+00:00)
Title: Stateless authentication broken

I made this patch many months ago for a project I am working on. We have been successfully using this patch to allow us to do stateless authentication (no sessions) on a API built using Symfony2.

When disabling sessions support inside config.yml, the Symfony/Component/Security/Http/Firewall/ContextListener does not properly check if a session is available before trying to save to the session inside onKernelResponse. Adding the check for the session resolves this problem.