I removed FosUserBundle and develop my own User module. Since then i have this error that popsup when i try to serialize the session.
$session->set($this->sessionKey, serialize($token));
EDIT 1 : I posted this question even if I have the answer, since I spent 3 days on this problem and it can help someone else (my future me passing by for instance)
EDIT 2 : since I once again had this issue (without FosUserBundle) I thanks "Stefan I" to have taken time to explained his experience)
The problem was the User entity wasn't correctly seralized in session. I had to modify my entity as follow.
If you don't serialize your User, the entire object will be serialied in _security_main (or _security_yourfirewall) variable session. For me it was more than 100 000 char length.
I had to update my serialize function since Symfony 6.3