8000 minor #15426 Fixed the use of Session with RequesStack (charlesen) · pableu/symfony-docs@75c09a3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 75c09a3

Browse files
committed
minor symfony#15426 Fixed the use of Session with RequesStack (charlesen)
This PR was merged into the 5.3 branch. Discussion ---------- Fixed the use of Session with RequesStack $this->session is never instanciated. We have to use $this->requestStack->getSession() instead <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/releases for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `5.x` for features of unreleased versions). --> Commits ------- 471038c Fixed the use of Session with RequesStack
2 parents bad3a25 + 471038c commit 75c09a3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

session.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,10 @@ controllers if you type-hint an argument with
153153
$this->requestStack->getSession()->set('attribute-name', 'attribute-value');
154154

155155
// gets an attribute by n 6971 ame
156-
$foo = $this->session->get('foo');
156+
$foo = $this->requestStack->getSession()->get('foo');
157157

158158
// the second argument is the value returned when the attribute doesn't exist
159-
$filters = $this->session->get('filters', []);
159+
$filters = $this->requestStack->getSession()->get('filters', []);
160160

161161
// ...
162162
}

0 commit comments

Comments
 (0)
0