-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Fix broken web test cases with session already started #4451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Look at #2040. It's quite old, but there is at least some "reason" =) |
@stloyd it seems to me that doing a session_id() (and now as $session->setId()) is still wrong. |
@guilhermeblanco - When I was doing the session refactoring I wanted to make exactly the patch this PR now but I didnt because I wast sure if there were reasons I was unaware of. @fabpot - I would merge this PR if it fixes the related tickets. |
Commits ------- 3ad01c0 Update src/Symfony/Bundle/FrameworkBundle/EventListener/TestSessionListener.php Discussion ---------- Fix broken web test cases with session already started This PR fixes the issues highlighted in PR #4445 and #3741 by not overriding the session id if the session is already started. --------------------------------------------------------------------------- by travisbot at 2012-05-29T19:06:33Z This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1468970) (merged 3ad01c0 into adf07f1). --------------------------------------------------------------------------- by stloyd at 2012-05-29T19:07:54Z Look at #2040. It's quite old, but there is at least some "reason" =) --------------------------------------------------------------------------- by guilhermeblanco at 2012-05-29T20:57:27Z @stloyd it seems to me that doing a session_id() (and now as $session->setId()) is still wrong. The right should be a regeneration of the id then, which would still make my code pass. The problem is that setId method checks for a possible regeneration/double attribution, which prevents an already started session (from a WebTestCase) to live peacefully with the TestSessionListener, because it will always try to set an id. So either we allow to regenerate ids or this code is not only useless for 2.1, but actually broken. --------------------------------------------------------------------------- by drak at 2012-05-30T02:42:47Z @guilhermeblanco - When I was doing the session refactoring I wanted to make exactly the patch this PR now but I didnt because I wast sure if there were reasons I was unaware of. @fabpot - I would merge this PR if it fixes the related tickets.
What would be the reason that I am still seeing this error? I ran a simple test for logging a user in:
I'm currently using FOS UserBundle && FacebookBundle. The logs still show me:
I ran an update through composer to get all latest components but still seeing this so I'm wondering where else it could come from. |
@khepin There is a problem with the facebook bundle if I recall: FriendsOfSymfony/FOSFacebookBundle#79 (comment) |
This PR fixes the issues highlighted in PR #4445 and #3741 by not overriding the session id if the session is already started.