From 4e601174c252a96ffdd8debce88b85d03ec895fc Mon Sep 17 00:00:00 2001 From: Sebastian Goettschkes Date: Sat, 23 Mar 2013 13:41:35 +0100 Subject: [PATCH] Fixing variable name for target_path --- cookbook/security/target_path.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cookbook/security/target_path.rst b/cookbook/security/target_path.rst index 2aa42d9a40a..99e85207ec4 100644 --- a/cookbook/security/target_path.rst +++ b/cookbook/security/target_path.rst @@ -5,9 +5,10 @@ How to change the Default Target Path Behavior ============================================== By default, the security component retains the information of the last request -URI in a session variable named ``_security.target_path``. Upon a successful -login, the user is redirected to this path, as to help her continue from -the last known page she visited. +URI in a session variable named ``_security.main.target_path`` (with ``main`` being +the name of the firewall area, defined in the ``security.yml``). Upon a successful +login, the user is redirected to this path, as to help her continue from the last +known page she visited. On some occasions, this is unexpected. For example when the last request 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``:: return; } - $request->getSession()->set('_security.target_path', $request->getUri()); + $request->getSession()->set('_security.main.target_path', $request->getUri()); } }