'Prevent storing entire user in Symfony session
My app is using Symfony 5.4.2 and is relying on the new Authenticator Manager.
I recently encountered memory errors related to session_open(). When investigating I noticed the entire User entity is stored in the session file (as a PHP serialized string), starting with _sf2_attributes|.
So every related entity is stored there as well (every property, user purchases and their details, and so on), which can be pretty heavy (I have session files that are more than 100 Kb, which sounds enormous to me).
Is that expected to work this way?
Is there a way to prevent serializing all User entity properties?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
