File tree 1 file changed +7
-6
lines changed
1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -1810,8 +1810,8 @@ with a locale. This can be done by defining a different prefix for each locale
1810
1810
Stateless Routes
1811
1811
----------------
1812
1812
1813
- Routes can configure a ``stateless `` boolean option in order to make sure that the controller
1814
- is not using the session during the request handling.
1813
+ Routes can configure a ``stateless `` boolean option in order to make sure that
1814
+ the session won't ever be used when matching a request:
1815
1815
1816
1816
.. configuration-block ::
1817
1817
@@ -1857,7 +1857,7 @@ is not using the session during the request handling.
1857
1857
1858
1858
// config/routes.php
1859
1859
use App\Controller\MainController;
1860
- use Symfony\Component \Routing\Loader\Configurator\RoutingConfigurator;
1860
+ use Symfony\Bundle\FrameworkBundle \Routing\Loader\Configurator\RoutingConfigurator;
1861
1861
1862
1862
return function (RoutingConfigurator $routes) {
1863
1863
$routes->add('homepage', '/')
@@ -1866,9 +1866,10 @@ is not using the session during the request handling.
1866
1866
;
1867
1867
};
1868
1868
1869
- If a stateless declared route is using the session, the application will:
1870
- - Throw an `Symfony\\Component\\HttpKernel\\Exception\\UnexpectedSessionUsageException ` when debugging is enabled
1871
- - Log a warning when debugging is disabled.
1869
+ Now, if the session is used, the application will report it based on your
1870
+ ``kernel.debug `` parameter:
1871
+ * ``enabled ``: will throw an :class: `Symfony\\ Component\\ HttpKernel\\ Exception\\ UnexpectedSessionUsageException ` exception
1872
+ * ``disabled ``: will log a warning
1872
1873
1873
1874
.. tip ::
1874
1875
You can’t perform that action at this time.
0 commit comments