{"action":"created","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/13269","labels_url":"https://api.github.com/repos/symfony/symfony/issues/13269/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/13269/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/13269/events","html_url":"https://github.com/symfony/symfony/issues/13269","id":53414230,"number":13269,"title":"[Security] login_check route throws exception on php 5.4.4: Parent session handler is not open","user":{"login":"derrabus","id":1506493,"avatar_url":"https://avatars.githubusercontent.com/u/1506493?v=3","gravatar_id":"","url":"https://api.github.com/users/derrabus","html_url":"https://github.com/derrabus","followers_url":"https://api.github.com/users/derrabus/followers","following_url":"https://api.github.com/users/derrabus/following{/other_user}","gists_url":"https://api.github.com/users/derrabus/gists{/gist_id}","starred_url":"https://api.github.com/users/derrabus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derrabus/subscriptions","organizations_url":"https://api.github.com/users/derrabus/orgs","repos_url":"https://api.github.com/users/derrabus/repos","events_url":"https://api.github.com/users/derrabus/events{/privacy}","received_events_url":"https://api.github.com/users/derrabus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-01-05T16:31:58Z","updated_at":"2015-01-06T13:31:11Z","closed_at":null,"body":"I tried to upgrade my client's Symfony application from 2.5.8 to the lastest 2.6-dev snapshot (12d8261). Unfortunately, the upgrade broke their login process completely, which worked fine with 2.6.1 and below.\r\n\r\nI could reproduce the problem by creating a new Symfony Standard application and implementing a login form as described [in the cookbook](http://symfony.com/doc/current/cookbook/security/form_login_setup.html). If I enter correct credentials in the form here, I get the following exception on the login_check route.\r\n\r\n```\r\n[1] Symfony\\Component\\Debug\\Exception\\ContextErrorException: Warning: SessionHandler::write(): Parent session handler is not open\r\n    at n/a\r\n        in /home/develop/projects/session-test/app/cache/dev/classes.php line 4606\r\n\r\n    at Symfony\\Component\\Debug\\ErrorHandler->handleError('2', 'SessionHandler::write(): Parent session handler is not open', '/home/develop/projects/session-test/app/cache/dev/classes.php', '4606', array('sessionId' => 'vq1u2n2d008k0mbmc2hi0j0v55', 'data' => '_sf2_attributes|a:1:{s:17:\"_security_default\";s:853:\"C:74:\"Symfony\\Component\\Security\\Core\\Authentication\\Token\\UsernamePasswordToken\":765:{a:3:{i:0;N;i:1;s:7:\"default\";i:2;s:722:\"a:4:{i:0;O:41:\"Symfony\\Component\\Security\\Core\\User\\User\":7:{s:51:\"Symfony\\Component\\Security\\Core\\User\\Userusername\";s:4:\"demo\";s:51:\"Symfony\\Component\\Security\\Core\\User\\Userpassword\";s:4:\"demo\";s:50:\"Symfony\\Component\\Security\\Core\\User\\Userenabled\";b:1;s:60:\"Symfony\\Component\\Security\\Core\\User\\UseraccountNonExpired\";b:1;s:64:\"Symfony\\Component\\Security\\Core\\User\\UsercredentialsNonExpired\";b:1;s:59:\"Symfony\\Component\\Security\\Core\\User\\UseraccountNonLocked\";b:1;s:48:\"Symfony\\Component\\Security\\Core\\User\\Userroles\";a:1:{i:0;s:9:\"ROLE_USER\";}}i:1;b:1;i:2;a:1:{i:0;O:41:\"Symfony\\Component\\Security\\Core\\Role\\Role\":1:{s:47:\"Symfony\\Component\\Security\\Core\\Role\\Rolerole\";s:9:\"ROLE_USER\";}}i:3;a:0:{}}\";}}\";}_sf2_flashes|a:0:{}_sf2_meta|a:3:{s:1:\"u\";i:1420472792;s:1:\"c\";i:1420472792;s:1:\"l\";s:1:\"0\";}'))\r\n        in  line \r\n\r\n    at SessionHandler->write('vq1u2n2d008k0mbmc2hi0j0v55', '_sf2_attributes|a:1:{s:17:\"_security_default\";s:853:\"C:74:\"Symfony\\Component\\Security\\Core\\Authentication\\Token\\UsernamePasswordToken\":765:{a:3:{i:0;N;i:1;s:7:\"default\";i:2;s:722:\"a:4:{i:0;O:41:\"Symfony\\Component\\Security\\Core\\User\\User\":7:{s:51:\"Symfony\\Component\\Security\\Core\\User\\Userusername\";s:4:\"demo\";s:51:\"Symfony\\Component\\Security\\Core\\User\\Userpassword\";s:4:\"demo\";s:50:\"Symfony\\Component\\Security\\Core\\User\\Userenabled\";b:1;s:60:\"Symfony\\Component\\Security\\Core\\User\\UseraccountNonExpired\";b:1;s:64:\"Symfony\\Component\\Security\\Core\\User\\UsercredentialsNonExpired\";b:1;s:59:\"Symfony\\Component\\Security\\Core\\User\\UseraccountNonLocked\";b:1;s:48:\"Symfony\\Component\\Security\\Core\\User\\Userroles\";a:1:{i:0;s:9:\"ROLE_USER\";}}i:1;b:1;i:2;a:1:{i:0;O:41:\"Symfony\\Component\\Security\\Core\\Role\\Role\":1:{s:47:\"Symfony\\Component\\Security\\Core\\Role\\Rolerole\";s:9:\"ROLE_USER\";}}i:3;a:0:{}}\";}}\";}_sf2_flashes|a:0:{}_sf2_meta|a:3:{s:1:\"u\";i:1420472792;s:1:\"c\";i:1420472792;s:1:\"l\";s:1:\"0\";}')\r\n        in /home/develop/projects/session-test/app/cache/dev/classes.php line 4606\r\n\r\n    at Symfony\\Component\\HttpFoundation\\Session\\Storage\\Proxy\\SessionHandlerProxy->write('vq1u2n2d008k0mbmc2hi0j0v55', '_sf2_attributes|a:1:{s:17:\"_security_default\";s:853:\"C:74:\"Symfony\\Component\\Security\\Core\\Authentication\\Token\\UsernamePasswordToken\":765:{a:3:{i:0;N;i:1;s:7:\"default\";i:2;s:722:\"a:4:{i:0;O:41:\"Symfony\\Component\\Security\\Core\\User\\User\":7:{s:51:\"Symfony\\Component\\Security\\Core\\User\\Userusername\";s:4:\"demo\";s:51:\"Symfony\\Component\\Security\\Core\\User\\Userpassword\";s:4:\"demo\";s:50:\"Symfony\\Component\\Security\\Core\\User\\Userenabled\";b:1;s:60:\"Symfony\\Component\\Security\\Core\\User\\UseraccountNonExpired\";b:1;s:64:\"Symfony\\Component\\Security\\Core\\User\\UsercredentialsNonExpired\";b:1;s:59:\"Symfony\\Component\\Security\\Core\\User\\UseraccountNonLocked\";b:1;s:48:\"Symfony\\Component\\Security\\Core\\User\\Userroles\";a:1:{i:0;s:9:\"ROLE_USER\";}}i:1;b:1;i:2;a:1:{i:0;O:41:\"Symfony\\Component\\Security\\Core\\Role\\Role\":1:{s:47:\"Symfony\\Component\\Security\\Core\\Role\\Rolerole\";s:9:\"ROLE_USER\";}}i:3;a:0:{}}\";}}\";}_sf2_flashes|a:0:{}_sf2_meta|a:3:{s:1:\"u\";i:1420472792;s:1:\"c\";i:1420472792;s:1:\"l\";s:1:\"0\";}')\r\n        in  line \r\n\r\n    at session_write_close()\r\n        in /home/develop/projects/session-test/app/cache/dev/classes.php line 4386\r\n\r\n    at Symfony\\Component\\HttpFoundation\\Session\\Storage\\NativeSessionStorage->save()\r\n        in /home/develop/projects/session-test/app/cache/dev/classes.php line 4214\r\n\r\n    at Symfony\\Component\\HttpFoundation\\Session\\Session->save()\r\n        in /home/develop/projects/session-test/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/SaveSessionListener.php line 55\r\n\r\n    at Symfony\\Component\\HttpKernel\\EventListener\\SaveSessionListener->onKernelResponse(object(FilterResponseEvent), 'kernel.response', object(ContainerAwareEventDispatcher))\r\n        in  line \r\n\r\n    at call_user_func(array(object(SaveSessionListener), 'onKernelResponse'), object(FilterResponseEvent), 'kernel.response', object(ContainerAwareEventDispatcher))\r\n        in /home/develop/projects/session-test/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Debug/WrappedListener.php line 59\r\n\r\n    at Symfony\\Component\\EventDispatcher\\Debug\\WrappedListener->__invoke(object(FilterResponseEvent), 'kernel.response', object(ContainerAwareEventDispatcher))\r\n        in  line \r\n\r\n    at call_user_func(object(WrappedListener), object(FilterResponseEvent), 'kernel.response', object(ContainerAwareEventDispatcher))\r\n        in /home/develop/projects/session-test/app/cache/dev/classes.php line 3876\r\n\r\n    at Symfony\\Component\\EventDispatcher\\EventDispatcher->doDispatch(array(object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener)), 'kernel.response', object(FilterResponseEvent))\r\n        in /home/develop/projects/session-test/app/cache/dev/classes.php line 3809\r\n\r\n    at Symfony\\Component\\EventDispatcher\\EventDispatcher->dispatch('kernel.response', object(FilterResponseEvent))\r\n        in /home/develop/projects/session-test/app/cache/dev/classes.php line 3970\r\n\r\n    at Symfony\\Component\\EventDispatcher\\ContainerAwareEventDispatcher->dispatch('kernel.response', object(FilterResponseEvent))\r\n        in /home/develop/projects/session-test/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php line 112\r\n\r\n    at Symfony\\Component\\EventDispatcher\\Debug\\TraceableEventDispatcher->dispatch('kernel.response', object(FilterResponseEvent))\r\n        in /home/develop/projects/session-test/app/bootstrap.php.cache line 3040\r\n\r\n    at Symfony\\Component\\HttpKernel\\HttpKernel->filterResponse(object(RedirectResponse), object(Request), '1')\r\n        in /home/develop/projects/session-test/app/bootstrap.php.cache line 3011\r\n\r\n    at Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw(object(Request), '1')\r\n        in /home/develop/projects/session-test/app/bootstrap.php.cache line 2982\r\n\r\n    at Symfony\\Component\\HttpKernel\\HttpKernel->handle(object(Request), '1', true)\r\n        in /home/develop/projects/session-test/app/bootstrap.php.cache line 3131\r\n\r\n    at Symfony\\Component\\HttpKernel\\DependencyInjection\\ContainerAwareHttpKernel->handle(object(Request), '1', true)\r\n        in /home/develop/projects/session-test/app/bootstrap.php.cache line 2376\r\n\r\n    at Symfony\\Component\\HttpKernel\\Kernel->handle(object(Request))\r\n        in /home/develop/projects/session-test/web/app_dev.php line 18\r\n```\r\n\r\nThis problem only appears on our old virtual machine running php 5.4.4. On my dev machine running Ubuntu 14.10 with the bundled php 5.5.12, everything works as expected. So, this issue is probably related to that old php version. Maybe, we're facing a similar issue here as in #5868 (just guessing)?\r\n\r\nMy client is aware, that this php version is fairly old, but the application has several hundred installations and most of them under that old php version, so the migration to a more recent php release will take some time. Untill then, I would need a fix or a workaround."},"comment":{"url":"https://api.github.com/repos/symfony/symfony/issues/comments/68864982","html_url":"https://github.com/symfony/symfony/issues/13269#issuecomment-68864982","issue_url":"https://api.github.com/repos/symfony/symfony/issues/13269","id":68864982,"user":{"login":"derrabus","id":1506493,"avatar_url":"https://avatars.githubusercontent.com/u/1506493?v=3","gravatar_id":"","url":"https://api.github.com/users/derrabus","html_url":"https://github.com/derrabus","followers_url":"https://api.github.com/users/derrabus/followers","following_url":"https://api.github.com/users/derrabus/following{/other_user}","gists_url":"https://api.github.com/users/derrabus/gists{/gist_id}","starred_url":"https://api.github.com/users/derrabus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derrabus/subscriptions","organizations_url":"https://api.github.com/users/derrabus/orgs","repos_url":"https://api.github.com/users/derrabus/repos","events_url":"https://api.github.com/users/derrabus/events{/privacy}","received_events_url":"https://api.github.com/users/derrabus/received_events","type":"User","site_admin":false},"created_at":"2015-01-06T13:31:11Z","updated_at":"2015-01-06T13:31:11Z","body":"Thanks for the quick answer, @xelaris. I digged into that issue and came to the same conclusion. I'm in favor for option two, since your patch works well on reasonably new php versions. Adding a new strategy just because of old quirky php versions is overkill, imho. I'd like to keep that complexity out of the framework configuration."}}