Month: April 2021

  • How to get the user id in a service in Symfony 5

    How to get the user id in a service in Symfony 5

    There are a few ways I have found to get a user id. None of the classes you can inject such as UserInterface, SessionInterface, TokenInterface, Security etc.   contain an actual getUserId() method. There is absolutely no method named this other than in the user Entity, if your entity contains a column named id. You can  […]

  • How does login and authentication work in Symfony 5.*

    How does login and authentication work in Symfony 5.*

    This is basically just my notes at this time and what I have found. I’ll keep adding to it over time. I can never, ever for the life of me remember how this complicated BS works. To learn that see the links section. Here is an excellent article about the files involved, the process etc. […]

  • Symfony Session resources list

    Symfony Session resources list

    Plain session docs – This is the symfony documentation page about Sessions alone. This link shows the basic configuration and use of Sessions in Symfony. This also mentions not starting a session for Anonymous users and has links to other info about sessions. Configuring Sessions and Save handlers – Symfony documentation link. This covers more […]