Symfony: cookies get lost in iframe in Internet Explorer

I have a form with an iframe target. The called url is the login_check in Symfony, to which I send _username and _password, to instantly log in. The problem: the Internet Explorer loses the cookies in an iframe. So I had to add a header which I do by adding a listener:

namespace Package\SomeBundle\EventListener;

use Symfony\Component\HttpKernel\Event\FilterResponseEvent;

class ResponseListener{
    public function onKernelResponse(FilterResponseEvent $event){
        $event->getResponse()->headers->set('P3P', 'CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"');

This Listener is registered in services.yml:

        class: Package\SomeBundle\EventListener\ResponseListener
            - {name: kernel.event_listener, event: kernel.response, method: onKernelResponse}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.