Skip to content

Commit 4e60117

Browse files
committed
Fixing variable name for target_path
1 parent 20b272d commit 4e60117

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

cookbook/security/target_path.rst

Lines changed: 5 additions & 4 deletions
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)