Skip to content

Cannot set session ID after the session has started. #5161

Closed
@danielec7

Description

@danielec7

I'm starting to receive this error after upgrading to 2.1 during tests. I've seen there are other tickets with this issue but they are old and closed.

I'm receiving the error for example with this code:

<?php
$client = static::createClient();

$crawler = $client->request('GET', '/contattaci/');

$this->assertTrue(200 === $client->getResponse()->getStatusCode());

// Fill in the form and submit it
$form = $crawler->selectButton('submit')->form(array(
'mp_contacttype[name]'  => 'Test',
'mp_contacttype[email]'  => 'test@test.com',
'mp_contacttype[phone]'  => '34534534',
'mp_contacttype[message]'  => 'Test',
));

$client->submit($form);

The last client response is 500 error Cannot set session ID after the session has started. This test worked before. Has something changed?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions