symfony/symfony — Issue #2512: Cookie path problem in tests
Author: mgruner
Created: 2011-10-28 20:11:43+00:00
State: open

Let's assume we have an application with sessions with the following routes:

/1
/1/2
/1/2/3
/1/3

The first path, when called from a WebTestCase, will create a cookie in the local Client object with the path set to "/". Calling the second route will renew the cookie, setting its path to /1. The third will update the cookie's path to /1/2.

Now when I call the fourth route, the cookie is not available any more for that request, because it is set to another path (/1/2 instead of / or /1). The cookie will not be sent and therefore the application will create a new cookie. This breaks my test cases, obviously.

Please let me know if this is an error on my side, or if I can provide further information with this problem.