symfony5 easyadmin3 session_start(): Function spl_autoload_call() hasn't defined the class it was called for

Problem

When integrating symfony5 with a legacy php application session managements can collide and lead to the following error:

session_start(): Function spl_autoload_call() hasn't defined the class it was called for
in vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php (line 156)

Solution

Use a separate session id for symfony5

// src/Kernel.php
public function boot(): void
{
    parent::boot();

    $session = new Session(new PhpBridgeSessionStorage());
    $session->setName('my_session_id);
    $session->start();
}

Reference

https://symfony.com/doc/current/components/http_foundation/session_php_bridge.html