diff --git a/session.rst b/session.rst index 2898ba5d70b..9ee5ebea31e 100644 --- a/session.rst +++ b/session.rst @@ -149,6 +149,10 @@ if you type-hint an argument with :class:`Symfony\\Component\\HttpFoundation\\Re public function __construct(RequestStack $requestStack) { $this->requestStack = $requestStack; + + // Accessing the session in the constructor is *NOT* reommended, since + // it might not be accessible yet or lead to unwanted side-effects + // $this->session = $requestStack->getSession(); } public function someMethod()