Stateless Route Attribute

Description

When set to true declare that Sessions can’t be used during handling of request. Generates Exception if route tries to use the Sessions.

Syntax

// src/Controller/MainController.php
namespace App\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;

class MainController extends AbstractController
{
/**
* @Route(”/”, name=“homepage”, stateless=true)
*/
public function homepage()
{
// …
}
}