Skip to content

Commit 46ce5a4

Browse files
committed
Merge pull request #2345 from Sgoettschkes/issue2253
Fixing variable name for target_path
2 parents 7e2f8b9 + 4e60117 commit 46ce5a4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

cookbook/security/target_path.rst

+5-4
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ How to change the Default Target Path Behavior
55
==============================================
66

77
By default, the security component retains the information of the last request
8-
URI in a session variable named ``_security.target_path``. Upon a successful
9-
login, the user is redirected to this path, as to help her continue from
10-
the last known page she visited.
8+
URI in a session variable named ``_security.main.target_path`` (with ``main`` being
9+
the name of the firewall area, defined in the ``security.yml``). Upon a successful
10+
login, the user is redirected to this path, as to help her continue from the last
11+
known page she visited.
1112

1213
On some occasions, this is unexpected. For example when the last request
1314
URI was an HTTP POST against a route which is configured to allow only a POST
@@ -61,7 +62,7 @@ Next, create your own ``ExceptionListener``::
6162
return;
6263
}
6364

64-
$request->getSession()->set('_security.target_path', $request->getUri());
65+
$request->getSession()->set('_security.main.target_path', $request->getUri());
6566
}
6667
}
6768

0 commit comments

Comments
 (0)