Symfony2 PHP 5.4.4无法更改活动会话的ID

Symfony2 PHP 5.4.4无法更改活动会话的ID,php,session,symfony,Php,Session,Symfony,目前,我们在Symfony2中安装了web应用程序,发现了一个阻塞问题 linux Debian哮喘病 PHP 5.4.4 Symfony版本2.1.10-DEV-app/DEV/debug 异常的致命错误: 供应商/symfony/symfony/src/symfony/Component/HttpFoundation/Session/Storage/Proxy/AbstractProxy.php throw new\LogicException'无法更改活动服务器的ID 会议' 堆栈跟踪:

目前,我们在Symfony2中安装了web应用程序,发现了一个阻塞问题

linux Debian哮喘病 PHP 5.4.4 Symfony版本2.1.10-DEV-app/DEV/debug 异常的致命错误:

供应商/symfony/symfony/src/symfony/Component/HttpFoundation/Session/Storage/Proxy/AbstractProxy.php throw new\LogicException'无法更改活动服务器的ID 会议'

堆栈跟踪:

在kernel.root_dir/cache/dev/classes.php的第484行-+ 公共函数setId$id { 如果$this->isActive{ 抛出new\LogicException“无法更改活动会话的ID”; } 会话id$id; 在AbstractProxy->setId“09g5hbsvg1apk8d32k52l19rr5” 在kernel.root_dir/cache/dev/classes.php的第208行-+ 在NativeSessionStorage->setId“09g5hbsvg1apk8d32k52l19rr5” 在kernel.root_dir/cache/dev/classes.php的第780行-+ 在会话->设置ID“09g5hbsvg1apk8d32k52l19rr5” 在/home/wwwmain/www_v5/vendor/symfony/symfony/src/symfony/Bundle/FrameworkBundle/EventListener/TestSessionListener.php中 第54行-+ 在TestSessionListener->OnKernelRequestObjectGetResponseEvent 在调用用户函数arrayobjectTestSessionListener“onKernelRequest”时,objectGetResponseEvent 在/home/wwwmain/www_v5/vendor/symfony/symfony/src/symfony/Component/HttpKernel/Debug/containerawareTracableEventDispatcher.php中 第139行-+ 在ContainerWareTracableEventDispatcher->doDispatch arrayarrayobjectProfilerListener“onKernelRequest”中, arrayobjectTestSessionListener,'onKernelRequest', arrayobjectSessionListener,'onKernelRequest', arrayobjectRouterListener,'onKernelRequest', arrayobjectLocaleListener,'onKernelRequest', ArrayObject防火墙,“onKernelRequest”, arrayobjectRequestListener,'onKernelRequest', ArrayObjectTwigeExtension2,'onKernelRequest', arrayobjectRequestListener、'onKernelRequest'、'kernel.request', objectGetResponseEvent 在kernel.root_dir/cache/dev/classes.php的第4781行-+ 在EventDispatcher->dispatch'kernel.request',objectGetResponseEvent 在kernel.root_dir/cache/dev/classes.php的第4999行-+ 在ContainerWareeventDispatcher->dispatch'kernel.request',objectGetResponseEvent 在/home/wwwmain/www_v5/vendor/symfony/symfony/src/symfony/Component/HttpKernel/Debug/containerawareTracableEventDispatcher.php中 第78行-+ 在ContainerWareTracableEventDispatcher->dispatch'kernel.request',objectGetResponseEvent 在第1412行的kernel.root_dir/bootstrap.php.cache中-+ 在HttpKernel->handleRaw objectRequest中,“1” 在第1392行的kernel.root_dir/bootstrap.php.cache中-+ 在HttpKernel->handle objectRequest“1”处,为true 在第1568行的kernel.root_dir/bootstrap.php.cache中-+ 在HttpKernel->handle objectRequest“1”处,为true 在kernel.root_dir/bootstrap.php.cache的第619行-+ 在内核->处理对象请求 在第25行的/home/wwwmain/www_v5/web/app_dev.php中-+

日志:

调试-通知事件kernel.request到侦听器 Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelRequest。 调试-向侦听器发出通知的事件kernel.request Symfony\Bundle\FrameworkBundle\EventListener\TestSessionListener::onKernelRequest。 调试-向侦听器Symfony\Component\HttpKernel\EventListener\ProfilerListener::OnKerneleException通知事件kernel.exception。 调试-通知侦听器的事件kernel.exception Symfony\Component\HttpKernel\EventListener\ExceptionListener::onKernelException。 CRITICAL-LogicException:无法在更改活动会话未捕获异常的ID /home/wwwmain/www_v5/app/cache/dev/classes.php第484行 调试-向侦听器发出通知的event kernel.request Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelRequest。 调试-向侦听器发出通知的事件kernel.request Symfony\Bundle\FrameworkBundle\EventListener\TestSessionListener::onKernelRequest。 调试-向侦听器发出通知的事件kernel.request Symfony\Bundle\FrameworkBundle\EventListener\SessionListener::onKernelRequest。 调试-向侦听器发出通知的event kernel.request Symfony\Component\HttpKernel\EventListener\RouterListener::onKernelRequest。 调试-通知侦听器Symfony\Component\HttpKernel\EventListener\LocaleListener::onKernelRequest的event kernel.request。 调试-通知事件kernel.request到侦听器Symfony\Component\Security\Http\Firewall::onKernelRequest。 调试-通知事件kernel.request到侦听器Eyrolles\CompteBundle\Service\RequestListener::onKernelRequest。 调试-通知事件kernel.request到侦听器Eyrolles\EcommerceBundle\Twig\Extension\TwigExtension2::onKernelRequest。 调试-通知事件内核。对侦听器的请求Symfony\Bundle\AsseticBundle\EventListener \RequestListener::onKernelRequest。 调试-通知事件kernel.controller到侦听器Symfony\Bundle\FrameworkBundle\DataCollector\RouterDataCollector::onKernelController。 调试-通知事件kernel.controller到侦听器Sensio\Bundle\FrameworkExtraBundle\EventListener\ControllerListener::onKernelController。 调试-通知事件kernel.controller到侦听器Sensio\Bundle\FrameworkExtraBundle\EventListener\ParamConverterListener::onKernelController。 调试-通知事件kernel.controller到侦听器Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener::onKernelController。 调试-通知事件kernel.controller到侦听器Symfony\Component\HttpKernel\DataCollector\RequestDataCollector::onKernelController


有什么想法吗?

看起来您正在运行phpunit测试?如果是这样,那么calss TestSessionListener在找到具有会话名称的Cookie时调用Session::setId


我,也遇到这个问题。看起来唯一的方法是扩展该类并覆盖test.session.listener.class参数。

您使用过稳定版本的Symfony吗?如果您知道您实际在做什么,也很高兴。请输入代码示例!。