Symfony 5.1 adds important new features related to routing, such as priority for route annotations and simpler route config. In this article we'll show other minor but interesting features added to routing.

Added stateless route attribute¶

Routes can now configure a stateless boolean option. If set to true , they declare that session won't be used during the handling of the request.

If a stateless route uses the session, you'll see an exception when debug is enabled in the application and you'll get a log message when debug is disabled: