symfony/symfony — pull request #6342 by baldurrensch (2012-12-14 04:55:49+00:00)
Title: [Session] Fixed bug with mock file session storage

Fixed a bug where an unstarted mock session would be emptied with a save. Here are the steps to reproduce:

1. Use the test client from `Symfony\Bundle\FrameworkBundle\Test\WebTestCase::createClient()`, and add something to its session. (I actually authenticated).
2. Take the cookies of this first test client and add them to a second test client
3. Have the second test client request a URL that results in a 404
4. Since the 404 does not need to start the session, hence when save is called (automatically), the mock session is overwritten with an empty array. This does not happen with the other session handlers.

The added unit test in this PR shows this problem. If this PR gets accepted, will it also get merged into the 2.1.x-dev branch?

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
License of the code: MIT
Documentation PR: -