I’ve worked on similar hybrid setups during migrations — especially between Symfony versions — and this kind of session management conflict is pretty common.
Is there a proper way to tell Symfony 6 to not start a session but use the existing one?
// In a Symfony 6 controller or service
$session = $request->getSession();
if ($session->isStarted()) {
// Access session safely without triggering session_start()
$userId = $session->get('user_id');
}
But to avoid starting the session, you must: